Re: [rfc][patch] swap: virtual swap readahead

Rik van Riel
2009-05-27T17:32:56Z

Johannes Weiner wrote:

> This patch makes swap-in base its readaround window on the virtual
> proximity of pages in the faulting VMA, as an indicator for pages
> needed in the near future, while still taking physical locality of
> swap slots into account.
>
> This has the advantage of reading in big batches when the LRU order
> matches the swap slot order while automatically throttling readahead
> when the system is thrashing and swap slots are no longer nicely
> grouped by LRU order.

This is a nice simple implementation of proper
swapin readahead. The performance results are
surprisingly good.

I suspect the performance oddity you see with
single-process qsbench might be due to qsbench
having a weird access pattern that just happens
to benefit from getting pages back into memory
in LRU order - not something that I expect to
be common, so not a concern.

> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: Rik van Riel <riel@redhat.com>

Reviewed-by: Rik van Riel <riel@redhat.com>