Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2003 03:50:15 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        FreeBSD current users <current@freebsd.org>
Subject:   Re: small scheduler hack/patch
Message-ID:  <3F0E9667.9C6652AE@mindspring.com>
References:  <20030710214339.GA48547@ns1.xcllnt.net> <20030710222839.GA49321@ns1.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Marcel Moolenaar wrote:
> On Thu, Jul 10, 2003 at 03:03:41PM -0700, Julian Elischer wrote:
> > it comes I think from the fact that some hardware treats things as
> > bitmaps. (?)
> 
> I have to guess that a bitmap is a natural way to represent sets
> when the sets aren't large and that this is why we use bitmaps.
> We have a need to send an IPI to multiple CPUs, which is expressed
> nicely with bitmaps.

Many CISC processors support the necessary instructions for an
implementation of the magic "bit-fu" necessary to do things like
finding the first bit, counting bits, etc., in O(log2).  If you
are trying to perform set operations (union, disunion, intersect,
least common member, greatest common member, etc.), then bitmaps
are a much more natural represntation for this than it would first
appear.

If you read back over the excerpt I posted from the Intel manual,
you'll see that you can send IPIs to *groups* of processors, and
this wording was pretty explicitly chosen, rather than saying
"broadcast".

As one example, you could add a processor to the "idle group", in
Julian's latest patch, and then IPI the idle group.  This would
wake up the processors that were idle, in case the event that
resulted in one process going on the run queue was responsible for
other processes going on the run queue at the same time.

Another example would be adding a processor to the "power managed"
group, and actually powering down its private support circuitry to
save electricity when, for example you were on a 4 CPU system, and
only had a 25% capacity processing load.

There's a lot of gold in that mine...

-- Terry



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