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

Peter Osterlund
2004-07-14T20:00:20Z

William Lee Irwin III <wli@holomorphy.com> 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@telia.com