Re: [PATCH] VM: Implements the swap-out page-clustering technique
From: Rik van Riel
Date: Sat Sep 06 2008 - 01:42:01 EST
On Fri, 5 Sep 2008 21:45:01 +0200
Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> Yes, but that has nothing to do in how much you should swap cluster.
>
> AFAIK the main motivation for swap clustering is to avoid the extreme
> seekiness that happens during swap in (that is the main reason
> why swap on Linux often takes so long). And also to use the IO
> device well. IO devices today typically have a "minimum useful
> unit of IO" which is much larger than a page. Typically it's at least
> a MB, sometimes even more e.g. on flash or on some RAID controllers.
That is indeed the reason.
Basically, the swap IO size should be large enough that
swap throughput is not incredibly slow when swapping in
lots of related data in a process.
On the other hand, you do want to avoid evicting data
that the process is still using, just because you are
swapping out a not recently referenced page on a
nearby virtual address.
I suspect that the swap IO cluster could contain nearby
and virtually contiguous pages that are (1) not recently
referenced and (2) on the inactive list.
Of course, my guess may be wrong - this needs testing :)
--
All rights reversed.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/