PM / Hibernate: fix the number of pages used for hibernate/thaw buffering
authorBojan Smojver <bojan@rexursive.com>
Tue, 24 Apr 2012 21:53:28 +0000 (23:53 +0200)
committerVarun Wadekar <vwadekar@nvidia.com>
Mon, 30 Apr 2012 12:38:24 +0000 (17:38 +0530)
commit216680715b120ba95162de0bda96821b0ed677ef
tree09d9a972e1b90281751bcf115c683cda9394eda7
parent2a32e95ff71f0c5969b403a7e2b8f1ac2f30ee0c
PM / Hibernate: fix the number of pages used for hibernate/thaw buffering

Hibernation regression fix, since 3.2.

Calculate the number of required free pages based on non-high memory
pages only, because that is where the buffers will come from.

Commit 081a9d043c983f161b78fdc4671324d1342b86bc introduced a new buffer
page allocation logic during hibernation, in order to improve the
performance. The amount of pages allocated was calculated based on total
amount of pages available, although only non-high memory pages are
usable for this purpose. This caused hibernation code to attempt to over
allocate pages on platforms that have high memory, which led to hangs.

Signed-off-by: Bojan Smojver <bojan@rexursive.com>
Signed-off-by: Rafael J. Wysocki <rjw@suse.de>
kernel/power/swap.c