[lkml]   [1996]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Swapping algorithm
   Date: 	Mon, 22 Apr 96 18:26 BST
From: Jamie Lokier <>

I like. How about: gather statistics about working sets in the usual
way, based on the usual page faults. Do it better, of course.
Occasionally, unmap a few random pages from random processes, so that
they trigger page faults and add to the statistics. The pages are still
in the page cache, of course, so it doesn't take long to map them back.
Although there is a speed penalty for this, the improved statistics, if
used well, mean that you are far less likely to swap out pages that are
actively in use. How else do you find the working set of a process
without swapping it all to disk?

Or the heuristic could work like this. When we take a page out of a
processes VMA we add a "current-jiffies" marker to the vma when we do
this. The next time we take a fault in that vma we see how long the
jiffies have gone since we took that page away. Using this we decide
later on whether it is a good idea to steal from that vma. And we
re-juvenate these values or retest every so often.

David S. Miller

 \ /
  Last update: 2005-03-22 13:37    [W:0.053 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site