[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [uPATCH] small kswapd improvement ???



On Wed, 4 Mar 1998, Dr. Werner Fink wrote:

> Maybe that's the reason why the bigger initial age for swapped in pages gives
> an improvement in 2.0.33 ... it's a ``better protection'' for often needed
> pages.

I think I'm going to try a more LRU like aging algorithm
now. (I've worked with some SGI boxes at school, and it
looks like they're less phrone to trashing)

Algorithm:

age_page(page) {
	page->age >>= 1;
}
touch_page(page) {
	page->age >>= 1;
	page->age |= 0x80;
}

and in vmscan.c/filemap.c:

-	if (page->age)
+	if (page->age < 1 << (MIN_SWAP_AGE + (nr_free_pages < free_pages_low 
? 1 : 0))

Then we could use the MIN_SWAP_AGE sysctl variable
to control the CPU usage / swap 'precision' of
kswapd. Even better would be a dynamic adjusment,
so kswapd would:
- never use more than 5% CPU (over a 10 sec interval?)
- use the maximum precision possible
- scan a maximum of MIN_SWAP_AGE + 2 times the number of
  pages it frees

Rik.
+-----------------------------+------------------------------+
| For Linux mm-patches, go to | "I'm busy managing memory.." |
| my homepage (via LinuxHQ).  | H.H.vanRiel@fys.ruu.nl       |
| ...submissions welcome...   | http://www.fys.ruu.nl/~riel/ |
+-----------------------------+------------------------------+