Re: Context switch times

Benjamin LaHaise
2001-10-04T22:53:41Z

On Thu, Oct 04, 2001 at 10:42:37PM +0000, Linus Torvalds wrote:
> Could we try to hit just two? Probably, but it doesn't really matter,
> though: to make the lmbench scheduler benchmark go at full speed, you
> want to limit it to _one_ CPU, which is not sensible in real-life
> situations. The amount of concurrency in the context switching
> benchmark is pretty small, and does not make up for bouncing the locks
> etc between CPU's.

I don't quite agree with you that it doesn't matter. A lot of tests
(volanomark, other silly things) show that the current scheduler jumps
processes from CPU to CPU on SMP boxes far too easily, in addition to the
lengthy duration of run queue processing when loaded down. Yes, these
applications are leaving too many runnable processes around, but that's
the way some large app server loads behave. And right now it makes linux
look bad compared to other OSes.

Yes, low latency is good, but jumping around cpus adds more latency in
cache misses across slow busses than is needed when the working set is
already present in the 2MB L2 of your high end server.

-ben