Re: [PATCH] swapin readahead

Stephen C. Tweedie
1998-12-02T17:35:38Z

Hi,

On Tue, 1 Dec 1998 19:32:52 +0100 (CET), Rik van Riel
<H.H.vanRiel@phys.uu.nl> said:

> I took the bet that shrink_mmap() would take care of that, but
> aperrantly not always :(

shrink_mmap() only gets rid of otherwise unused pages (pages whose count
is one). After read_swap_cache_async(), the page count will be three:
once for the swap cache, once for the io in progress, once for the
reference returned by read_swap_cache_async(). You need to free that
last reference explicitly after doing the readahead call. The io
reference will be returned once IO completes, and shrink_mmap() will
take care of the final swap cache reference.

--Stephen