The kernel swap daemon (2.0.*) question

rusling@linux.reo.dec.com
Sat, 21 Feb 1998 15:14:33 +0000 (Local Time Zone Unknown)


All,
could anyone shed light on the order in which the swap
daemon tries to free up pages when the system starts to run out
of physical memory? It tries to free pages in the following order:

(1) reducing the size of the page and buffer caches
(2) swapping out shared pages
(3) swapping out dirty pages, discarding clean pages

I can see why it tries (1) first, it's relatively easy to
do but I don't see why it tries (2) next. Note that the code
remembers which "state" that it's in and so it will start freeing
using the last successful method. I would have thought that freeing
shared pages (shared via IPC or via sharing images/libraries) would
affect many processes and the swapped out pages would be fairly
likely to be needed again. (3) only "hurts" one process at a time,
(2) "hurts" lots. Any clues would be useful.

Whilst I am at it. Why does it always "remember" the last
successful method? Shouldn't that be dependent on how agressively
it is swapping, say by looking at free_pages_low and free_pages_high?

Just a thought

Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu