summaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-05-24 22:16:31 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2009-06-12 21:32:32 +0200
commitc6f37f12197ac3bd2e5a35f2f0e195ae63d437de (patch)
treee9609ca63d211911582afcc4b8314887b85a6c46 /kernel/power
parente240b58c79144708530138e05f17c6d0d8d744a8 (diff)
downloadlinux-c6f37f12197ac3bd2e5a35f2f0e195ae63d437de.tar.gz
linux-c6f37f12197ac3bd2e5a35f2f0e195ae63d437de.tar.bz2
linux-c6f37f12197ac3bd2e5a35f2f0e195ae63d437de.zip
PM/Suspend: Do not shrink memory before suspend
Remove the shrinking of memory from the suspend-to-RAM code, where it is not really necessary. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Nigel Cunningham <nigel@tuxonice.net> Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 46386b9f8dd1..2a19f347bd8a 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -188,9 +188,6 @@ static void suspend_test_finish(const char *label)
#endif
-/* This is just an arbitrary number */
-#define FREE_PAGE_NUMBER (100)
-
static struct platform_suspend_ops *suspend_ops;
/**
@@ -226,7 +223,6 @@ int suspend_valid_only_mem(suspend_state_t state)
static int suspend_prepare(void)
{
int error;
- unsigned int free_pages;
if (!suspend_ops || !suspend_ops->enter)
return -EPERM;
@@ -241,24 +237,10 @@ static int suspend_prepare(void)
if (error)
goto Finish;
- if (suspend_freeze_processes()) {
- error = -EAGAIN;
- goto Thaw;
- }
-
- free_pages = global_page_state(NR_FREE_PAGES);
- if (free_pages < FREE_PAGE_NUMBER) {
- pr_debug("PM: free some memory\n");
- shrink_all_memory(FREE_PAGE_NUMBER - free_pages);
- if (nr_free_pages() < FREE_PAGE_NUMBER) {
- error = -ENOMEM;
- printk(KERN_ERR "PM: No enough memory\n");
- }
- }
+ error = suspend_freeze_processes();
if (!error)
return 0;
- Thaw:
suspend_thaw_processes();
usermodehelper_enable();
Finish: