lkml.org 
[lkml]   [2009]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/4] PM/Hibernate: Use memory allocations to free memory (rev. 2)


On Sun, 3 May 2009, Rafael J. Wysocki wrote:
>
> Remove the shrinking of memory from the suspend-to-RAM code, where it is
> not really necessary.

Hmm. Shouldn't we do this _regardless_?

IOW, shouldn't this be a totally separate patch? It seems to be left-over
from when we shared the same code-paths, and before the split of the STR
and hibernate code?

IOW, shouldn't the very _first_ patch just be this part? That code doesn't
make any sense anyway (that FREE_PAGE_NUMBER really _is_ totally
arbitrary).

This part seems to be totally independent of all the other parts in your
patch-series. No?

Linus

---
kernel/power/main.c | 19 +------------------
1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/kernel/power/main.c b/kernel/power/main.c
index f99ed6a..e3197e9 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;

/**
@@ -241,24 +238,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:

\
 
 \ /
  Last update: 2009-05-03 05:15    [W:0.501 / U:1.488 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site