linux-kernel-test/kernel/power
Rafael J. Wysocki 8fd37a4c98 PM / hibernate: Create memory bitmaps after freezing user space
The hibernation core uses special memory bitmaps during image
creation and restoration and traditionally those bitmaps are
allocated before freezing tasks, because in the past GFP_KERNEL
allocations might not work after all tasks had been frozen.

However, this is an anachronism, because hibernation_snapshot()
now calls hibernate_preallocate_memory() which allocates memory
for the image upfront anyway, so the memory bitmaps may be
allocated after freezing user space safely.

For this reason, move all of the create_basic_memory_bitmaps()
calls after freeze_processes() and all of the corresponding
free_basic_memory_bitmaps() calls before thaw_processes().

This will allow us to hold device_hotplug_lock around hibernation
without the need to worry about freezing issues with user space
processes attempting to acquire it via sysfs attributes after the
creation of memory bitmaps and before the freezing of tasks.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
2013-08-31 02:49:33 +02:00
..
autosleep.c PM / Sleep: avoid 'autosleep' in shutdown progress 2013-07-15 01:31:37 +02:00
block_io.c block: kill off REQ_UNPLUG 2011-03-10 08:52:27 +01:00
console.c PM: make VT switching to the suspend console optional v3 2013-02-20 01:33:41 +01:00
hibernate.c PM / hibernate: Create memory bitmaps after freezing user space 2013-08-31 02:49:33 +02:00
Kconfig Merge branch 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2013-07-02 19:53:30 -07:00
main.c PM / Sleep: Warn about system time after resume with pm_trace 2013-06-27 22:14:46 +02:00
Makefile PM / Sleep: Add user space interface for manipulating wakeup sources, v3 2012-05-01 21:26:05 +02:00
power.h PM / Hibernate: Enable suspend to both for in-kernel hibernation. 2012-07-01 13:31:22 +02:00
poweroff.c power/sysrq: fix inconstistent help message of sysrq key 2013-04-30 17:04:10 -07:00
process.c freezer: set PF_SUSPEND_TASK flag on tasks that call freeze_processes 2013-07-30 14:05:06 +02:00
qos.c PM / QoS: Fix workqueue deadlock when using pm_qos_update_request_timeout() 2013-08-14 00:42:05 +02:00
snapshot.c Merge branch 'akpm' (updates from Andrew Morton) 2013-07-03 17:12:13 -07:00
suspend_test.c driver-core: constify data for class_find_device() 2013-02-06 12:18:56 -08:00
suspend.c PM / wakeup: Adjust messaging for wake events during suspend 2013-06-11 23:53:37 +02:00
swap.c PM / Hibernate: use rb_entry 2012-11-15 00:37:08 +01:00
user.c PM / hibernate: Create memory bitmaps after freezing user space 2013-08-31 02:49:33 +02:00
wakelock.c PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock 2012-07-19 00:00:58 +02:00