Re: Can't make use of swap memory in 2.6.7-bk19

William Lee Irwin III
2004-07-14T05:20:24Z

On Thu, Jul 08, 2004 at 11:30:45AM +0200, Peter Osterlund wrote:
> swappiness is set to 60.
> However, I realized that I had set /proc/sys/vm/laptop_mode to 1. If I set
> it to 0, 2.6.7-bk10 starts to work.

Probably not what will get merged, but does the following brutal hack
do anything for you?

Index: laptop-2.6.8-rc1/mm/vmscan.c
===================================================================
--- laptop-2.6.8-rc1.orig/mm/vmscan.c 2004-07-11 10:33:55.000000000 -0700
+++ laptop-2.6.8-rc1/mm/vmscan.c 2004-07-13 22:18:04.193959968 -0700
@@ -902,7 +902,7 @@
sc.may_writepage = 0;

inc_page_state(allocstall);
-
+retry:
for (i = 0; zones[i] != 0; i++)
zones[i]->temp_priority = DEF_PRIORITY;

@@ -940,8 +940,14 @@
if (sc.nr_scanned && priority < DEF_PRIORITY - 2)
blk_congestion_wait(WRITE, HZ/10);
}
- if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
- out_of_memory();
+ if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY)) {
+ if (!laptop_mode || sc.may_writepage)
+ out_of_memory();
+ else {
+ sc.may_writepage = 1;
+ goto retry;
+ }
+ }
out:
for (i = 0; zones[i] != 0; i++)
zones[i]->prev_priority = zones[i]->temp_priority;