Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2002 00:49:13 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Peter Wemm <peter@wemm.org>
Cc:        Andrew Gallatin <gallatin@cs.duke.edu>, John Baldwin <jhb@FreeBSD.ORG>, freebsd-smp@FreeBSD.ORG
Subject:   Re: hlt when idle?
Message-ID:  <3CD0EF79.FC1DA1A8@mindspring.com>
References:  <20020502040716.CE4BA38CC@overcee.wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm wrote:
> IMHO, it is probably worth just putting the halts in and be done with it.
> Firing off an IPI to wake up cpus is the correct fix though.  The catch is
> that is expensive so you have to know when to do it and when not to. ie:
> keep some sort of idle/busy state and have the add-run-queue checks notice
> that they added a new runnable process (vs previously idle) and notice that
> there is an idle cpu that could pick it up and fire an IPI in its
> direction.  Only experimentation will tell us if this is worth it.

Yeah.

I looked at doing the IPI thing back in 1996 with Jack Vogel's
original FreeBSD SMP code from October of 1995, and it turned
into an incredible mess really quickly.

I know a lot more now than I did then, but I'd still hesitate to
do it, unless I was being paid to bash my head against the wall
until the wall broke.  8-(.

The one comment I'd make about "just putting the halts in" is
that it becomes a progressively worse trade-off the more CPUs
there are in the machine.

Of course, it's not like anyone is building a lot of large CPU
count systems, like back in the Sequent 32 CPU machine days,
but I know of at least two 8 CPU boxes that might lose based on
adding in the HLT.

The real problem is that when you have a crapload of CPUs, you
generally have them for a reason, which involves shared state,
which means multiple sleepers on shared resources.  So you may
be missing the wakeup on 6 processes on a shared wait.  That
can really add up, and it's not going to show up in a heterogenous
load, like you get from a "make world".  For all we know, a
homogeneous load could show negative effects at 4 or even 2
CPUs.  8-(.

Maybe it could be made into a compile time option?  My preference
would be to default it "off", to encourage someone to bash their
head on "the right fix" (with a comment to that effect, so that
someone doesn't "fix it"; have to have learned something from the
ATA write caching default state toggle war...).

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CD0EF79.FC1DA1A8>