Re: [PATCH] swapin readahead

Stephen C. Tweedie
1998-12-01T15:13:31Z

Hi Rik,

In article <Pine.LNX.3.96.981127001214.445A-100000@mirkwood.dummy.home>,
Rik van Riel <H.H.vanRiel@phys.uu.nl> writes:

> here is a very first primitive version of as swapin
> readahead patch. It seems to give much increased
> throughput to swap and the desktop switch time has
> decreased noticably.

> The checks are all needed. The first two checks are there
> to avoid annoying messages from swap_state.c :))

There's a third check needed, I think, which probably accounts for the
swap_duplicate errors people have been noting. You need to skip pages
which are marked as locked in the swap_lockmap, or the async page read
may block (you might be trying to read in a page which is still being
written to swap). In this case, by the time you have slept, the swap
entry is not necessarily still in use, so you may end up reading an
unused swap entry. That would certainly lead to swap_duplicate
warnings, although I think they should be benign.

--Stephen