diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-09-11 20:58:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-26 17:18:38 -0700 |
commit | ff278af4dcda812b4a3f8ef0d0260232ed1352ac (patch) | |
tree | daca7323d18c2d8b3efa8cc346732bb9c6374063 /kernel/async.c | |
parent | 2af3495b6359c30740b31175aa818f600f5b8bb9 (diff) |
PM / Hibernate: Avoid hitting OOM during preallocation of memory
commit 6715045ddc7472a22be5e49d4047d2d89b391f45 upstream.
There is a problem in hibernate_preallocate_memory() that it calls
preallocate_image_memory() with an argument that may be greater than
the total number of available non-highmem memory pages. If that's
the case, the OOM condition is guaranteed to trigger, which in turn
can cause significant slowdown to occur during hibernation.
To avoid that, make preallocate_image_memory() adjust its argument
before calling preallocate_image_pages(), so that the total number of
saveable non-highem pages left is not less than the minimum size of
a hibernation image. Change hibernate_preallocate_memory() to try to
allocate from highmem if the number of pages allocated by
preallocate_image_memory() is too low.
Modify free_unnecessary_pages() to take all possible memory
allocation patterns into account.
Reported-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: M. Vefa Bicakci <bicave@superonline.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/async.c')
0 files changed, 0 insertions, 0 deletions