]> git.baikalelectronics.ru Git - kernel.git/commit
PM / Hibernate: Fix preallocating of memory
authorRafael J. Wysocki <rjw@sisk.pl>
Thu, 25 Feb 2010 21:32:37 +0000 (22:32 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Fri, 26 Feb 2010 19:39:13 +0000 (20:39 +0100)
commit00af07bb8304265268d20c7a48aa8c250b2c11c4
tree0270bcf49069839e43b913e1fd718ca8fc7bd451
parentc19d36532127eb42257512370a5c2f32ee9d0eb1
PM / Hibernate: Fix preallocating of memory

The hibernate memory preallocation code allocates memory to push some
user space data out of physical RAM, so that the hibernation image is
not too large.  It allocates more memory than necessary for creating
the image, so it has to release some pages to make room for
allocations made while suspending devices and disabling nonboot CPUs,
or the system will hang due to the lack of free pages to allocate
from.  Unfortunately, the function used for freeing these pages,
free_unnecessary_pages(), contains a bug that prevents it from doing
the job on all systems without highmem.

Fix this problem, which is a regression from the 2.6.30 kernel, by
using the right condition for the termination of the loop in
free_unnecessary_pages().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Alan Jenkins <sourcejedi.lkml@googlemail.com>
Cc: stable@kernel.org
kernel/power/snapshot.c