lkml.org 
[lkml]   [2004]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: swappiness=0 makes software suspend fail.
Hi!

> >Andrew, in 2.6.6 shrink_all_memory() does not work if swappiness ==
> >0. shrink_all_memory() calls balance_pgdat(), that calls
> >shrink_zone(), and that calls refill_inactive_zone(), which looks at
> >swappiness.
> >
> >Additional parameter to all these calls neutralizing swappiness would
> >help, as would temporarily setting swappiness to 100 in
> >shrink_all_memory. Is there a less ugly solution?
>
> I have a cleanup patch that allows this sort of thing to easily
> be passed into the lower levels of reclaim functions. I don't
> know if it would be to Andrew's taste though...
>
> It basically replaces all function parameters in vmscan.c with
>
> struct scan_control {
> unsigned long nr_to_scan;
> unsigned long nr_scanned;
> unsigned long nr_reclaimed;
> unsigned int gfp_mask;
> struct page_state ps;
> int may_writepage;
> };
>
> So you could easily add a field for swsusp.
>
> Until something like this goes through, please don't fuglify
> vmscan.c any more than it is... do the saving and restoring
> thing that Nigel suggested please.

Okay, this should solve it.
Pavel

--- clean/mm/vmscan.c 2004-05-20 23:08:37.000000000 +0200
+++ linux/mm/vmscan.c 2004-05-30 21:45:41.000000000 +0200
@@ -1098,10 +1098,13 @@
pg_data_t *pgdat;
int nr_to_free = nr_pages;
int ret = 0;
+ int old_swappiness = vm_swappiness;
struct reclaim_state reclaim_state = {
.reclaimed_slab = 0,
};

+ vm_swappiness = 100;
+
current->reclaim_state = &reclaim_state;
for_each_pgdat(pgdat) {
int freed;
@@ -1115,6 +1118,8 @@
break;
}
current->reclaim_state = NULL;
+
+ vm_swappiness = old_swappiness;
return ret;
}
#endif

--
934a471f20d6580d5aad759bf0d97ddc
-
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 14:03    [W:0.070 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site