Subject: Re: Restartable Atomic Sequences
To: None <g.mcgarry@ieee.org>
From: None <cgd@broadcom.com>
List: tech-kern
Date: 07/05/2002 14:51:07
At Thu, 4 Jul 2002 22:08:08 +0000 (UTC), "Gregory McGarry" wrote:
> I will add machdep.llsc sysctl for model-specific library.
> Unfortunately, static binaries linked against libpthread currently
> don't work on mips.  Something wrong with _init() not being
> invoked.  But you do mention another issue to add to the list.

I'd say this is the wrong way to go about this.

the default should be something which can work on MP systems, etc.,
without any special libraries.  The special libraries should be
considered an optimization, _not_ necessary for correct operation
under any circumstances.  (RAS can work for certain kernel purposes on
MP systems, but that's it, right?)

Further, I'd _like_ to think that the commmon case going forward is
"cpus which have LL/SC," so that is what should be catered to.
Certainly, all of the new MIPS32/MIPS64 CPUs which show up will have
them.

That said, I believe the default should be ll/sc (emulated by the
kernel if not present in the HW), with a lib which uses RAS to
optimize things on older HW.

For static bins, given the huge performance difference, it's probably
"the right thing" to have function pointer(s), set on initial use, to
select the proper locking primitives unless compiling w/ flags that
narrow things down to a well-known CPU model.  Yeah, it's a bit of
extra overhead, but it's not that much in the "high-performance" case,
and it's a huge huge win in the "low-perforance" case.



cgd