aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-30 08:19:46 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-30 20:49:47 -0400
commit942f40155a743f4204308d62405dacaa4bfadb11 (patch)
treec65e934016413151824dcb6b15e0f2ae6ce1d23d /mm/memory_hotplug.c
parent8fd37a4c9822d58c93f764864582aa13112b1513 (diff)
PM / hibernate / memory hotplug: Rework mutual exclusion
Since all of the memory hotplug operations have to be carried out under device_hotplug_lock, they won't need to acquire pm_mutex if device_hotplug_lock is held around hibernation. For this reason, make the hibernation code acquire device_hotplug_lock after freezing user space processes and release it before thawing them. At the same tim drop the lock_system_sleep() and unlock_system_sleep() calls from lock_memory_hotplug() and unlock_memory_hotplug(), respectively. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index ca1dd3aa5eee..53ad1325d7a7 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -51,14 +51,10 @@ DEFINE_MUTEX(mem_hotplug_mutex);
51void lock_memory_hotplug(void) 51void lock_memory_hotplug(void)
52{ 52{
53 mutex_lock(&mem_hotplug_mutex); 53 mutex_lock(&mem_hotplug_mutex);
54
55 /* for exclusive hibernation if CONFIG_HIBERNATION=y */
56 lock_system_sleep();
57} 54}
58 55
59void unlock_memory_hotplug(void) 56void unlock_memory_hotplug(void)
60{ 57{
61 unlock_system_sleep();
62 mutex_unlock(&mem_hotplug_mutex); 58 mutex_unlock(&mem_hotplug_mutex);
63} 59}
64 60