weirdness in 4.2BSD w.r.t. "deficit"

Mike Kupfer kupfer at ucbvax.ARPA
Tue May 14 17:43:29 AEST 1985


The following line is from vmmeter():

	deficit -= imin(deficit,
	    imax(deficit / 10, ((klin * CLSIZE) / 2) * maxpgio / 2));

"Deficit" is used to avoid thrashing (suppose the swapper starts
bringing a process in, then turns around and says "gee, I've got plenty
of memory, I'll bring in another process", etc.).  Vmmeter() is called
once per second, and the idea seems to be to reduce "deficit" to
account for the effect of page-ins.  If the imax() were an imin(), I
could believe that the idea is to reduce the deficit by 10% (can you
say "heuristic"?), but to hedge by not reducing more than what we
expect is the average number of pages that might be brought in (average
page-in brings in 1/2 the maximum number of pages, and 1/2 of the
paging operations are page-ins).  Can anyone tell me why it's imax()?

Reply by mail, please.  Flames (or even snide remarks) about Berkeley
code to /dev/null.

Thanks.
-- 
Mike Kupfer
kupfer at ucb-arpa or kupfer at Berkeley
...!ucbvax!kupfer
``You can tell the pioneers by the arrows in their backs.''



More information about the Comp.unix.wizards mailing list