summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-07 22:22:41 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-07 22:22:41 +0200
commit31cb852809c86541c817538c98003678546dfa58 (patch)
tree324808c5a9def43a7f15c0fda97f58ee01f03c42 /kernel
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-block (diff)
parentPM / Hibernate: Fix free_unnecessary_pages() (diff)
downloadlinux-31cb852809c86541c817538c98003678546dfa58.tar.xz
linux-31cb852809c86541c817538c98003678546dfa58.zip
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM / Hibernate: Fix free_unnecessary_pages()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/snapshot.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index ace55889f702..06efa54f93d6 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1211,7 +1211,11 @@ static void free_unnecessary_pages(void)
to_free_highmem = alloc_highmem - save;
} else {
to_free_highmem = 0;
- to_free_normal -= save - alloc_highmem;
+ save -= alloc_highmem;
+ if (to_free_normal > save)
+ to_free_normal -= save;
+ else
+ to_free_normal = 0;
}
memory_bm_position_reset(&copy_bm);