Re: [uPATCH] SMP scheduling fix (?)

Neil Conway (nconway.list@ukaea.org.uk)
Fri, 15 Jan 1999 14:48:07 +0000


Gabriel Paubert wrote:
>
> On Fri, 15 Jan 1999, Neil Conway wrote:
> > [SNIP]
> > PS: Having bravely said the above without checking, I foolishly decided
> > to check. It wasn't the case. Running two CPU-hogs, one non-niced and
> > the other "nice +20", I got not the 95/5 split (actually 20/21 vs. 1/21
> > was what I expected), but a roughly 91.5/8.5 split. This means that the
> > niced process got about one eleventh of the CPU time.
> >
> > This doesn't square with what I read in the source code. "nice +20"
> > should give the niced process (i386 values here) ONE time-slice in every
> > round, while the non-niced should have 20 timeslices.
>
> It furiously looks like an off by one error (or an < versus <=
> comparison, or a postfix versus prefix increment or decrement)
> which would give actually 2 and 21 slices rather than 1 and 20:
>
> 2/23 ~= 8.7 %
> 21/23 ~= 91.3 %
>
> Gabriel.

I quite agree. Haven't looked closely yet, but the bad news is that at
least some 2.1 kernels have it too. I just checked 2.1.130 (SMP kernel,
UP box) and it does it too. My other 2.1 box is 2.1.131ac10 SMP
kernel/box and I can't use it for tests right now.

Then again, do we care :-) ? 5% isn't much different to 9% (!).

Neil

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/