[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200905070042.01880.rjw@sisk.pl>
Date: Thu, 7 May 2009 00:42:01 +0200
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: pm list <linux-pm@...ts.linux-foundation.org>
Cc: Wu Fengguang <fengguang.wu@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>, Pavel Machek <pavel@....cz>,
Nigel Cunningham <nigel@...onice.net>
Subject: [RFC][PATCH 2/5] PM/Suspend: Do not shrink memory before suspend
From: Rafael J. Wysocki <rjw@...k.pl>
Remove the shrinking of memory from the suspend-to-RAM code, where
it is not really necessary.
Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
---
kernel/power/main.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
Index: linux-2.6/kernel/power/main.c
===================================================================
--- linux-2.6.orig/kernel/power/main.c
+++ linux-2.6/kernel/power/main.c
@@ -188,9 +188,6 @@ static void suspend_test_finish(const ch
#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
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:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists