Re: [uPATCH] SMP scheduling fix (?)

Gabriel Paubert (paubert@iram.es)
Fri, 15 Jan 1999 15:08:03 +0100 (MET)


On Fri, 15 Jan 1999, Neil Conway wrote:

> Rather simpler than that... A nice value of 20 means you get about
> 1/20th as much as a process with a nice value of 0. 5% is too big for
> lots of things, and this is one of the reasons I like Rik et al.'s
> patches for sched_idle.
>
> Does anyone know why Linus doesn't like sched_idle things? (*Does* he
> dislike them??).
>
> Neil
>
> 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.

-
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/