Mailing List Archive

Buffer cache vs. swapping... Was: 2.2.0-pre6 ain't nice =(
Hello everyone!
I've been thinking about the relation between buffer cache and swap
subsystems (on my way to/from home for lunch :) ), more or less along
the following lines:
My problem: I started copying large files between filesystems
in background (on pre4 kernel which have been up for more than a week)
and found out that the process swapped out parts of my netscape/emacs
(presumable for buffer cache, right?). Not a good thing since I want
to continue my websurfing/editing while files are being copied... My
computer itself is pretty recent and has enough RAM not to swap at all
pbunyk:~/Mail> free
total used free shared buffers cached
Mem: 127444 120928 6516 30480 10576 61580
-/+ buffers/cache: 48772 78672
Swap: 72256 9564 62692
I managed to notice it only after some substantial uptime (as
mentioned) and I suppose the effect is that buffer cache somehow came
into equilibrum with swapping subsystem and when bringing in a new
page from disk it does not matter (for the kernel) if we drop a
swapping page or a buffer page. In reality it should matter --- the
substantial part of buffer pages will NOT be accessed at all (as in
file copying case) while we can be sufficiently sure that if we swap
out a page we WILL have to bring it back later.
Now the question: Is it possible to guarantee in the kernel
that if buffer cache have a choice between swapping out a page or
dropping a cache page which so far has been accessed ONLY ONCE it
always chooses the second option?
Has it been implemented? Did it work well? My understanding is
that VM fixes/balancing are the hot topic in the recent kernels, and I
do not really know the fine points of what was going on... Sorry if my
question is trivial or if my suggestion proved itself to be bad...
Sincerely,
Paul
--
("`-''-/").___..--''"`-._ UNIX *is* user-friendly, he is just very
`6_ 6 ) `-. ( ).`-.__.`) picky about who his friends are...
(_Y_.)' ._ ) `._ `. ``-..-' Paul Bunyk, Research Scientist
_..`--'_..-_/ /--'_.' ,'art by (and part-time UN*X sysadm)
(il),-'' (li),' ((!.-' F. Lee http://pbunyk.physics.sunysb.edu/~paul
-
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/