SysIII swapping strangeness

Henry Spencer henry at utzoo.UUCP
Thu Aug 15 04:12:04 AEST 1985


> Consider a heavily memory (over)loaded system, sometimes
> swapping continuously for 5-20 minutes at a time. Is it
> possible that processes are being swapped in and back out 
> many many times before they actually run? (some of these
> processes are > 500Kb).

Not inconceivable.  At the very least, they're not getting *much* run
time per swap.  This is not a trivial problem -- compute just how long
it takes even (say) an Eagle to swap a 500KB process!

> 1) Is this 2 second business left over from the pdp11
> 	where the address spaces were smaller?  Should
> 	I/do people change this?

No, it seems to be left over from systems that were not badly memory-short,
or at least didn't combine memory shortage with big long-running processes.
Even on the 11 this represented very bad behavior if you *did* have big
long-running processes.	 (I speak from experience.)

> 2) Shouldn't the swapper be changed to at least let the
> 	poor sucker get a few ticks before letting him
> 	go back out?

Yup.  In fact, it should be changed to let him have a fair bit of cpu time,
since even with very fast disks it takes the better part of a second to
swap half a megabyte in and out.  This WILL do bad things to the response
time of interactive programs that are competing with the big boy for memory.
This problem is fundamental and unsolvable:  if you cannot get both the
big boy and the interactive programs in memory at once, you have to choose
one or the other.  Trying to do both only results in thrashing.

> 3) Do all un*x systems (before demand paging came around)
> 	slow way,way,way down when anything but trivial
> 	swapping is occurring?

*All* Unix systems -- demand paging or not -- slow way,way,way down if
their physical memory is overcommitted.  "Real memory for real performance."
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.unix.wizards mailing list