Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579348

Re: [PATCH 0/2] fix devm_memremap_pages() mem hotplug locking

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/2] fix devm_memremap_pages() mem hotplug locking
Date 2017-02-13 02:40 +0100
Message-ID <tadMt-5gT-7@gated-at.bofh.it> (permalink)
References <taaYh-3zU-3@gated-at.bofh.it> <tadMt-5gT-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Feb 12, 2017 at 5:25 PM, Masayoshi Mizuma
<m.mizuma@jp.fujitsu.com> wrote:
> Hi Dan,
>
> On Sun, 12 Feb 2017 14:34:11 -0800 Dan Williams wrote:
>>
>> Ben notes that commit f931ab479dd2 "mm: fix devm_memremap_pages crash,
>> use mem_hotplug_{begin, done}" is incomplete and broken. Writes to
>> mem_hotplug.active_writer need to be coordinated under the device
>> hotplug lock. Otherwise, we can potentially corrupt mem_hotplug.refcount
>> leading to soft lockups.
>
>
> I think mem_hotplug_{begin,done} is not suitable to exclude
> devm_memremap_pages()
> because it seems that memory hotplug is not related to this context.
> How about using pgmap_lock instead?

The problem with that switch is the race in
kernel_physical_mapping_init(), see commit f931ab479dd2. As far as I
can see we need all paths that call kernel_physical_mapping_init() to
agree on the same lock, and can't use a private lock in
devm_memremap_pages().

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] fix devm_memremap_pages() mem hotplug locking Dan Williams <dan.j.williams@intel.com> - 2017-02-12 23:40 +0100
  [PATCH 2/2] mm: validate device_hotplug is held for memory hotplug Dan Williams <dan.j.williams@intel.com> - 2017-02-12 23:40 +0100
  [PATCH 1/2] mm, devm_memremap_pages: hold device_hotplug lock over  mem_hotplug_{begin, done} Dan Williams <dan.j.williams@intel.com> - 2017-02-12 23:40 +0100
  Re: [PATCH 0/2] fix devm_memremap_pages() mem hotplug locking Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> - 2017-02-13 02:40 +0100
    Re: [PATCH 0/2] fix devm_memremap_pages() mem hotplug locking Dan Williams <dan.j.williams@intel.com> - 2017-02-13 02:40 +0100

csiph-web