summaryrefslogtreecommitdiff
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-27 09:21:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-27 09:21:25 +0200
commit96fb7e256a0650c2b37768c780bf0f680b0049b6 (patch)
treefa6459ef844e2031466bbe71ded369b8b7aed368 /mm/memory_hotplug.c
parent7e040726850a106587485c21bdacc0bfc8a0cbed (diff)
parentc02ed2e75ef4c74e41e421acb4ef1494671585e8 (diff)
Merge 4.11-rc4 into driver-core-next
We want the fixes in here for merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c6
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 */