Excuse me Stephen I was a bit more agressive against the swap cache than I
would to be. I have not played a so high attention at what I wrote as
you done... (and are some days that I don' t sleep a lot of time ;-).
>Umm, you'd better read the kernel again! The swap cache _is_ used, a
>great deal. Currently it has two main functions: when we read in a
>page from swap for a read access, the swap cache keeps a reference to
>the swap entry on disk so that a subsequent swapout of the same page
>can avoid writing the page back to disk.
The point is that I' d like to find a software that swapin a page _only_
for reading it. Most of the software - even if it cause the swapin with a
read fault - than write also to its memory, causing the page to be removed
from the swap cache and to be assigned to the process if the swap cache
page was not shared (if there wasn' t many other process sharing that page
in _read_only_ mode) (this is what I understand reading 2.1.122).
>Secondly, as you refer to, if we have multiple process sharing the
>same swap entry, the swap cache is the only mechanism we have for
>finding an existing in-memory copy of a page which may have been
>swapped in by a different process.
Yes.
>In either case, the swap cache is most definitely beneficial. It is
>also not much of an overhead: there is zero memory overhead involved
>(we don't create copies of the page but map them directly, and the
>page cache headers are statically allocated), and only a page-cache
>lookup overhead on swapin.
Yes I was totally wrong using the word "overhead".
>> I am currently working (also Sthepen is working on that) to give a
>> _sense_ to the swap cache since it seems to be the right thing to
>> do.
>
>It already has a sense. The fact that it can equally be used for
>other things such as swap readahead doesn't detract from the important
>functions it already performs.
Yes, it' s useful but it' s not a real cache. It' s not caching. If it
would just cache nobody would report problems. The most important thing
that the swap cache could do it' s not done right now (2.1.122). Maybe I
consider it "the most important thing" only because it' s the only one
that doesn' t work yet ;-). I don' t know...
Andrea[s] Arcangeli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/