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

From: Peter Osterlund
Date: Wed Jul 14 2004 - 15:01:41 EST


William Lee Irwin III <wli@xxxxxxxxxxxxxx> writes:

> The only difference laptop_mode should have is dirty memory handling,
> but you don't have any dirty memory. Maybe swapcache is fooling things.
> Most notably, add_to_swap() sets the page dirty...
>
> Something is very wrong here... could you try this?
...
> Index: oom-2.6.8-rc1/mm/vmscan.c
> ===================================================================
> --- oom-2.6.8-rc1.orig/mm/vmscan.c 2004-07-14 06:17:13.876343912 -0700
> +++ oom-2.6.8-rc1/mm/vmscan.c 2004-07-14 06:22:15.986416200 -0700
> @@ -417,7 +417,8 @@
> goto keep_locked;
> if (!may_enter_fs)
> goto keep_locked;
> - if (laptop_mode && !sc->may_writepage)
> + if (laptop_mode && !sc->may_writepage &&
> + !PageSwapCache(page))
> goto keep_locked;
>
> /* Page is dirty, try to write it out here */

This patch fixes my problem. No more bogus OOMs in laptop mode, and
the test program runs approximately equally fast in laptop mode as it
does in "normal" mode.

Thanks.

--
Peter Osterlund - petero2@xxxxxxxxx
http://w1.894.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/