aha/kernel/power
Gerald Schaefer 98e73dc5d2 PM / Hibernate / Memory hotplug: Always use for_each_populated_zone()
Use for_each_populated_zone() instead of for_each_zone() in hibernation
code. This fixes a bug on s390, where we allow both config options
HIBERNATION and MEMORY_HOTPLUG, so that we also have a ZONE_MOVABLE
here. We only allow hibernation if no memory hotplug operation was
performed, so in fact both features can only be used exclusively, but
this way we don't need 2 differently configured (distribution) kernels.

If we have an unpopulated ZONE_MOVABLE, we allow hibernation but run
into a BUG_ON() in memory_bm_test/set/clear_bit() because hibernation
code iterates through all zones, not only the populated zones, in
several places. For example, swsusp_free() does for_each_zone() and
then checks for pfn_valid(), which is true even if the zone is not
populated, resulting in a BUG_ON() later because the pfn cannot be
found in the memory bitmap.

Replacing all occurences of for_each_zone() in hibernation code with
for_each_populated_zone() would fix this issue.

[rjw: Rebased on top of linux-next hibernation patches.]

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-09-14 20:26:59 +02:00
..
console.c PM: Wait for console in resume 2009-02-21 14:17:17 -08:00
hibernate.c PM/Hibernate: Do not release preallocated memory unnecessarily (rev. 2) 2009-09-14 20:26:58 +02:00
hibernate_nvs.c PM/Hibernate: Move NVS routines into a seperate file (v2). 2009-06-12 21:32:33 +02:00
Kconfig PM: Introduce core framework for run-time PM of I/O devices (rev. 17) 2009-08-23 00:04:44 +02:00
main.c PM: Introduce core framework for run-time PM of I/O devices (rev. 17) 2009-08-23 00:04:44 +02:00
Makefile PM/Hibernate: Move NVS routines into a seperate file (v2). 2009-06-12 21:32:33 +02:00
power.h PM/Hibernate: Do not release preallocated memory unnecessarily (rev. 2) 2009-09-14 20:26:58 +02:00
poweroff.c trivial: kernel/power/poweroff.c: whitespace fix 2009-06-12 18:01:46 +02:00
process.c mm, PM/Freezer: Disable OOM killer when tasks are frozen 2009-06-16 19:47:40 -07:00
snapshot.c PM / Hibernate / Memory hotplug: Always use for_each_populated_zone() 2009-09-14 20:26:59 +02:00
suspend.c PM: Separate suspend to RAM functionality from core 2009-06-12 21:32:33 +02:00
suspend_test.c PM: Separate suspend to RAM functionality from core 2009-06-12 21:32:33 +02:00
swap.c swap: Remove code handling bio_alloc failure with __GFP_WAIT 2009-04-15 12:10:13 +02:00
swsusp.c PM/Hibernate: Move NVS routines into a seperate file (v2). 2009-06-12 21:32:33 +02:00
user.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00