[net.unix-wizards] software clock bug fix

peter@hp-pcd.UUCP (Peter Robinson) (11/23/83)

#N:hp-pcd:19500007:000:1162
hp-pcd!peter    Nov 18 10:55:00 1983


A couple of weeks ago I posted a query about our software clock losing
significant amounts of time (up to 5 minutes a day). My thanks to all those
who responded and in particular to Brian Thomson, who furnished the following 
fix.

Since incorporating the change a week ago, we have lost only 17 seconds on
the clock.

					Peter Robinson
					Hewlett-Packard PCD
					Corvallis, OR

				{ucbvax!hplabs, harpo, ogcvax}!hp-pcd!peter

< VAX 750 running 4.1bsd >

---------------------------------------------------------------------------
< fix from Brian Thomson >

You are probably suffering from the infamous "bug fixed in 4.2",
discovered some years ago by a Mystery Person at Lucasfilm.
And it goes like this:

In clock.c, routine softclock(), the lines

	if((p1 = calltodo.c_next) == 0 || p1->c_time > 0)
		break;

should be replaced by

	if((p1 = calltodo.c_next) == 0 || p1->c_time > 0) {
		splx(s);
		break;
	}

The consequence of the bug is that the rest of softclock() used to
be executed at spl7(), which could make for missed clock interrupts.

			Brian Thomson,	    CSRG Univ. of Toronto
			{linus,ihnp4,uw-beaver,floyd,utzoo}!utcsrgv!thomson