diff options
| author | 2017-04-14 10:29:40 +0200 | |
|---|---|---|
| committer | 2017-04-14 10:29:40 +0200 | |
| commit | 0ba78a95a6629975ff16545ae868fa1bb38f786a (patch) | |
| tree | bb51f571bb187bc10f3a9639789afd4cf49b5b27 /mm/memory_hotplug.c | |
| parent | rtmutex: Plug preempt count leak in rt_mutex_futex_unlock() (diff) | |
| parent | Merge branch 'akpm' (patches from Andrew) (diff) | |
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/memory_hotplug.c')
| -rw-r--r-- | mm/memory_hotplug.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 295479b792ec..6fa7208bcd56 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -125,9 +125,12 @@ void put_online_mems(void) } +/* Serializes write accesses to mem_hotplug.active_writer. */ +static DEFINE_MUTEX(memory_add_remove_lock); + void mem_hotplug_begin(void) { - assert_held_device_hotplug(); + mutex_lock(&memory_add_remove_lock); mem_hotplug.active_writer = current; @@ -147,6 +150,7 @@ void mem_hotplug_done(void) mem_hotplug.active_writer = NULL; mutex_unlock(&mem_hotplug.lock); memhp_lock_release(); + mutex_unlock(&memory_add_remove_lock); } /* add this memory to iomem resource */ |
