Strange scheduling behavoir in SMP (kernel 2.2.14)

Stephen C. Tweedie sct en redhat.com
Lun Ene 31 19:20:59 CST 2000


Hi,

On Fri, 28 Jan 2000 19:54:26 +0100, Michael Schulz
<michael_schulz en public.uni-hamburg.de> said:

> Simple question then as at least to me the picture is not clear jet:
> How expensive is it to awake the background process and put it on a 
> _different_ cpu? Will this hurt more than help? Is this tradeoff
> balanced enuf for most real world situations?

That's not the situation --- the problem is what to do if you have two
foreground tasks running on two cpus, and one sleeps.  You don't have
the option of scheduling the background task on the other CPU at this
point --- at least, not without forcing a CPU switch on the other
foreground task, which rather defeats the purpose of the exercise.  So
you either have to run it on the local CPU, which may not have been the
last one to run the background task, or you have to just leave the local
CPU idle in the hope that the background task will soon be able to get a
shot at its "home" CPU.

That's why if you have a background task and two interactive tasks on a
2-CPU machine, you really cannot avoid the background task jumping
between CPUs unless you are willing to leave a CPU idle at times (and
that, in general, is a very bad thing to do.)

--Stephen

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



Más información sobre la lista de distribución Ayuda