lkml.org 
[lkml]   [2002]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectHot/cold allocation -- swsusp can not handle hot pages
Hi!

Swsusp counts free pages, and relies on fact that when it allocates
page there's one free page less. That is no longer true with hot
pages.

I attempted to work it around but it seems I am getting hot pages even
when I ask for cold one. This seems to fix it. Does it looks like
"possibly mergable" patch?

Pavel

--- clean/kernel/suspend.c 2002-11-01 00:37:42.000000000 +0100
+++ linux-swsusp/kernel/suspend.c 2002-11-01 22:51:28.000000000 +0100
@@ -549,7 +550,7 @@

pagedir_order = get_bitmask_order(SUSPEND_PD_PAGES(nr_copy_pages));

- p = pagedir = (suspend_pagedir_t *)__get_free_pages(GFP_ATOMIC, pagedir_order);
+ p = pagedir = (suspend_pagedir_t *)__get_free_pages(GFP_ATOMIC | __GFP_COLD, pagedir_order);
if(!pagedir)
return NULL;

@@ -558,11 +559,11 @@
SetPageNosave(page++);

while(nr_copy_pages--) {
- p->address = get_zeroed_page(GFP_ATOMIC);
+ p->address = get_zeroed_page(GFP_ATOMIC | __GFP_COLD);
if(!p->address) {
free_suspend_pagedir((unsigned long) pagedir);
return NULL;
}
SetPageNosave(virt_to_page(p->address));
p->orig_address = 0;
p++;
--- clean/mm/page_alloc.c 2002-11-01 00:37:44.000000000 +0100
+++ linux-swsusp/mm/page_alloc.c 2002-11-01 22:53:47.000000000 +0100
@@ -361,7 +361,7 @@
unsigned long flags;
struct page *page = NULL;

- if (order == 0) {
+ if ((order == 0) && !cold) {
struct per_cpu_pages *pcp;

pcp = &zone->pageset[get_cpu()].pcp[cold];

--
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.063 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site