Re: [uPATCH] SMP scheduling fix (?)

Max (max@Linuz.sns.it)
Fri, 15 Jan 1999 15:44:24 +0100 (MET)


On Fri, 15 Jan 1999, Gabriel Paubert wrote:

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

It's an off-by-one difference, but not an 'error'.
You get:
nice +19 = 1 slice (nice +20 doesn't exist, at least not in 2.0.x)
nice +0 = 20 slices
But the linux scheduler can choose to run for a slice even processes
with 0 slices left if there are no processes with higher counter.
So you get the +1 bias you say, in agreement with the numbers 8.7% / 91.3%.

> Gabriel.
>

Massimiliano Ghilardi

----------------------------------------------------------------
| I have yet to meet a person who had a bad experience of Linux. |
| Most have never had an experience. |
----------------------------------------------------------------

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