kernel-hacking-2024-linux-s.../drivers/base
Rafael J. Wysocki 91e7c75ba9 PM: Allow drivers to allocate memory from .prepare() callbacks safely
If device drivers allocate substantial amounts of memory (above 1 MB)
in their hibernate .freeze() callbacks (or in their legacy suspend
callbcks during hibernation), the subsequent creation of hibernate
image may fail due to the lack of memory.  This is the case, because
the drivers' .freeze() callbacks are executed after the hibernate
memory preallocation has been carried out and the preallocated amount
of memory may be too small to cover the new driver allocations.
Unfortunately, the drivers' .prepare() callbacks also are executed
after the hibernate memory preallocation has completed, so they are
not suitable for allocating additional memory either.  Thus the only
way a driver can safely allocate memory during hibernation is to use
a hibernate/suspend notifier.  However, the notifiers are called
before the freezing of user space and the drivers wanting to use them
for allocating additional memory may not know how much memory needs
to be allocated at that point.

To let device drivers overcome this difficulty rework the hibernation
sequence so that the memory preallocation is carried out after the
drivers' .prepare() callbacks have been executed, so that the
.prepare() callbacks can be used for allocating additional memory
to be used by the drivers' .freeze() callbacks.  Update documentation
to match the new behavior of the code.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-05-17 23:26:00 +02:00
..
power PM: Allow drivers to allocate memory from .prepare() callbacks safely 2011-05-17 23:26:00 +02:00
attribute_container.c
base.h PM: Remove sysdev suspend, resume and shutdown operations 2011-05-11 21:37:15 +02:00
bus.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-01-13 10:05:56 -08:00
class.c driver-core: merge private parts of class and bus 2010-11-17 14:21:08 -08:00
core.c driver core: Replace the dangerous to_root_device macro with an inline function 2011-02-03 16:36:40 -08:00
cpu.c
dd.c PM / Runtime: Rework runtime PM handling during driver removal 2011-05-17 23:19:17 +02:00
devres.c
devtmpfs.c convert get_sb_single() users 2010-10-29 04:16:28 -04:00
dma-coherent.c Driver core: internal struct dma_coherent_mem, change type of a member. 2010-08-05 13:53:33 -07:00
dma-mapping.c
driver.c
firmware.c
firmware_class.c PM: Print a warning if firmware is requested when tasks are frozen 2011-05-17 23:19:17 +02:00
hypervisor.c
init.c
iommu.c
isa.c
Kconfig PM: Remove sysdev suspend, resume and shutdown operations 2011-05-11 21:37:15 +02:00
Makefile PM / Core: Introduce struct syscore_ops for core subsystems PM 2011-03-15 00:43:46 +01:00
map.c
memory.c memory hotplug: sysfs probe routine should add all memory sections 2011-02-03 16:08:58 -08:00
module.c driver core: module.c: Use kasprintf 2010-05-21 09:37:29 -07:00
node.c memory hotplug: Update phys_index to [start|end]_section_nr 2011-02-03 16:08:57 -08:00
platform.c PM: Revert "driver core: platform_bus: allow runtime override of dev_pm_ops" 2011-05-16 20:17:47 +02:00
sys.c PM: Remove sysdev suspend, resume and shutdown operations 2011-05-11 21:37:15 +02:00
syscore.c PM: Add missing syscore_suspend() and syscore_resume() calls 2011-04-20 00:36:11 +02:00
topology.c topology/sysfs: Provide book id and siblings attributes 2010-09-09 20:41:25 +02:00
transport_class.c