kswap kernel daemon questions/thoughts

Ka'Plaagh (rusling@linux.reo.dec.com)
Wed, 18 Feb 1998 10:59:35 +0000


All,
looking at the kswap daemon code I noticed something a little strange.
Basically when it decides that it should run it tries to free either 3 or 6
pages (depends on which tide mark it just passed, free_pages_high or
free_pages_low). It tries a number of methods in turn, these are:

reducing the sizes of the buffer and page caches
swapping out shared pages
swapping out or discarding pages

It 'remembers' which of these it was doing the last time that it
tried to free physical pages in the system and starts from there again this
time. The kswap daemon runs periodically and checks the state of
the system's memory, it runs more often is there are less than free_pages_low
free pages.

There's a little state machine that does the remembering. If one
method fails, it moves onto the next method. Starting from the last place that it
tried saves it needlessly retrying something that may not work (I guess).
However, shouldn't it consider resetting the state to the first option once the
number of free pages in the system rises above free_pages_high? Also shouldn't
the number of pages that it frees relate to the positions of the high and low
free page mark as well as to their distance apart?

This occurred to me over breakfast and I haven't had chance to try
some changes and see what happens, but I will do. Is this behaviour
changing/changed in 2.1?

Just curious

Dave
- - - - ----------------------------------------------------------------------
David A Rusling Consulting Engineer
European Semiconductor Applications Digital Equipment Co Ltd.,
Engineering PO Box 121,
Imperial Way,
Worton Grange
Reading RG2 0TU
Linux, Alpha, StrongArm, PCI Tel: UK-(0)1734-204380
Fax: UK-(0)1734-203133
- - - - ----------------------------------------------------------------------

- - - ------- End of Unsent Draft

- - ------- End of Forwarded Message

- - ----------------------------------------------------------------------
David A Rusling Consulting Engineer
European Semiconductor Applications Digital Equipment Co Ltd.,
Engineering PO Box 121,
Imperial Way,
Worton Grange
Reading RG2 0TU
Linux, Alpha, StrongArm, PCI Tel: UK-(0)1734-204380
Fax: UK-(0)1734-203133
- - ----------------------------------------------------------------------

- ------- End of Unsent Draft

------- End of Forwarded Message

----------------------------------------------------------------------
David A Rusling Consulting Engineer
European Semiconductor Applications Digital Equipment Co Ltd.,
Engineering PO Box 121,
Imperial Way,
Worton Grange
Reading RG2 0TU
Linux, Alpha, StrongArm, PCI Tel: UK-(0)1734-204380
Fax: UK-(0)1734-203133
----------------------------------------------------------------------

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