[comp.arch] Context Switch Time, A worst Case

davis@clocs.cs.unc.edu (Mark Davis) (10/28/88)

I would like to add a little data to the discussion on the context
switching time of large register files.  Since my dissertation is on
architectures to reducing context switching time, I have a definate
bias.  Unfortunately for me, new architectures to reduce context switch
time will not save the world of Unix workstations.

The worst observed impact of context switch time is our timeshared VAX
11/780.  During the day it has about:
    70 users,
    250 processes, and a
    7 load average (~ average number of processes ready to run at any
                    instant).
In this condition, it switches context about 100 times per second (10
times faster that required by quantum).  We have measured context
switch time at about 1 ms (about the same as reported in literature).
In this case, 10% of the time is spent switching context.  (This is
considerably higher that some of the back of the envelope estimates
recently appearing in this newsgroup, but nothing to write home about.)

A Sun 4/280 running SunOS 3.5 takes about .5 msec to switch context.  We
find file servers context switch about 100 times/sec => %5.  These values
vary greatly, so I would not hang my hat on this % (You mileage ...).

For the Vax (running Mt Xinu BSD 4.3) and for the Sun 4 (a register
window machine) running SunOS, > 95% of the context-switch time is
spent on other tasks (mostly UNIX scheduling algorithms).  (Sun MMU's
get nasty if you exceed the magic number of 8 (Sun 3) or 16 (Sun 4),
but that's a different story.)

Note that in this business, the 10% performance improvement
(represented by reducing context switch time to 0 on our poor Vax)
takes about as long as it takes me to write this posting.

(There are applications where register save/restore time make a
difference.  Otherwise, I would be looking for another dissertation
topic.  Unix workstations is not the place, though.)

(The data quoted above was found by research partially supported by
some ONR grant or the other.)

Thanks - Mark (davis@cs.unc.edu or decvax!mcnc!davis)

lamaster@ames.arc.nasa.gov (Hugh LaMaster) (10/28/88)

In article <4908@thorin.cs.unc.edu> davis@clocs.cs.unc.edu (Mark Davis) writes:

>In this condition, it switches context about 100 times per second (10
>times faster that required by quantum).  We have measured context
>switch time at about 1 ms (about the same as reported in literature).
>In this case, 10% of the time is spent switching context.  (This is

>
>

My question is, how much of this context switching time is due to saving
the hardware state (my guess is that this is small) relative to the cost
of going through the scheduler to figure out what the next process to
run is (probably large)?


-- 
  Hugh LaMaster, m/s 233-9,  UUCP ames!lamaster
  NASA Ames Research Center  ARPA lamaster@ames.arc.nasa.gov
  Moffett Field, CA 94035     
  Phone:  (415)694-6117