headsup: swap_pager.c

David Schultz das at FreeBSD.ORG
Sun Aug 3 17:20:14 PDT 2003


On Fri, Aug 01, 2003, Dag-Erling Smrgrav wrote:
> "Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
> > The thing you overlook is that often when things gets paged out, the
> > system is short on memory and therefore more likely to not do anything
> > productive, whereas when things gets paged in, there are a better chance
> > of some other process being able to use the CPU time productively.
> > If we did predictive pageouts like some of the "serious" mainfram OS's
> > this would be less true.
> 
> How hard would it be to get the kernel to write the pages "most likely
> to be swapped out" to swap in the idle loop, to save time if / when
> they actually need to be swapped out later?
> 
> I thought we already did this to some extent (ref. FAQ 16.1), but
> apparently I was wrong?

FreeBSD already does that.  ;-)  You can control the number of
clean pages that it keeps around with the sysctls
vm.v_cache_{min,max}, but you shouldn't need to tune anything to
get good performance.  FWIW, the stuff phk is working on is
in a different area; it has to do with what swap device your
pages wind up on after the VM system has already decided to
write them out.


More information about the freebsd-arch mailing list