On Fri, 18 Dec 1998, MOLNAR Ingo wrote:
> On Fri, 18 Dec 1998, Linus Torvalds wrote:
> > On Fri, 18 Dec 1998, David S. Miller wrote:
> > >
> > > And most of the time on x86 it happens because idlers on SMP there
> > > just slam into the scheduler() over and over even when zero useful
> > > work is available.
> >
> > The idle loop calls "hlt", which waits for an interrupt.
>
> it can be significant if we have many interrupts which generate only a few
> reschedules, or cause reschedules for other CPUs (==good balancing). Even
> if other CPUs do not need the scheduler or task or runqueue lock, we
> possibly end up generating unnecessary bus traffic.
Ehh.. Any interrupt is going to be a _lot_ more costly than a few
cross-cpu cache misses.
Your argument goes: if we have lots of interrupts, we may have a number of
unnecessary re-schedules.
My argument goes: if we have that many interrupts, we don't care. The cost
of the idle task re-scheduling a few times unnecessarily is not going to
matter, and the cost of _not_ doing it is that we potentially run too much
in the idle task.
We could add the test for "current->need_resched" and only call the
scheduler then. I think Andrea did that. Fell free to send me timings, but
I don't want to change the scheduler just because somebody _thinks_ it
makes a difference.
Linus
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]