swap modification

utzoo!decvax!ucbvax!menlo70!sri-unix!chico!duke!phs!dennis at Berkeley utzoo!decvax!ucbvax!menlo70!sri-unix!chico!duke!phs!dennis at Berkeley
Sun Jan 3 23:25:07 AEST 1982


I have installed and have been running for several months a
modification to the swap algorithm which seems to give
better swap performance for systems with lots of terminals.
A less thrashy swapping pattern is observed.  The mod is 
to use p_size*p_time instead of just p_size when finding
a large process to swap out.

More specifically, when calculating maxsize, instead of
comparing it to rp->p_size, compare it to (rp->p_size*rp->p_time),
and set it to this also.  p_size+p_time was tried,
but it didn't work as effectively.

The effect of this is to swap out processes that have been
hanging around doing nothing, ie, inits and gettys.  I've
observed that they stay in until somebody runs spell or something
similar and then they all go out at once.  This is a large
instantaneous load, but it certainly beats getting your shell
swapped in and out repeatedly, which is how I noticed the problem.
Watching gettys languish in core while somebody's current shell
was swapped out annoyed me.

I have installed this in both vanilla v7 and 2.8bsd, and it
works fine in both cases.
Our 11/44 has .75Mb and 48 terminals, usual user load
around 15, and this has improved response time noticeably
at certain times.  It's certainly cut down on swapouts.



More information about the Comp.unix.wizards mailing list