Re: [PATCH] swapin readahead

Rik van Riel
1998-12-03T15:16:00Z

On Wed, 2 Dec 1998, Stephen C. Tweedie wrote:
> On 01 Dec 1998 18:20:49 +0100, Zlatko Calusic <Zlatko.Calusic@CARNet.hr>
> said:
>
> > Yes. something like that. Since nobody asked pages to swap in (we
> > decided to swap them in) it looks like nobody frees them. :)
> > So we should free them somewhere, probably.
>
> I think read_swap_page_async should be acting as a lookup on the page
> cache, so the page it returns is guaranteed to have an incremented
> reference count. You'll need to free_page() it just after the
> read_swap_page_async() call to get the expected behaviour.

I have now included the free_page() and things seem to work
out fine. In version 6 of the swapin readahead patch I also
fixed the swap_cache_find_* statistics. We really should make
those available through /proc/sys/vm/swapcache (and writable
so we can test the stats over a certain period of time).

Zlatko's hogmem.c gives pretty decent performance now, but I
guess it could be better by always doing readahead regardless
of whether the page is in memory or not...

OTOH, I have observed swapin rates of 5000+ swaps a second, or
3000 in/out :)

cheers,

Rik -- the flu hits, the flu hits, the flu hits -- MORE
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+