[Top] [All Lists]

Re: Once again: test_and_set for CPUs w/o LL/SC

To: "Maciej W. Rozycki" <>
Subject: Re: Once again: test_and_set for CPUs w/o LL/SC
From: Johannes Stezenbach <>
Date: Wed, 16 Oct 2002 14:52:33 +0200
Cc: "Kevin D. Kissell" <>,
In-reply-to: <>
Mail-followup-to: Johannes Stezenbach <>, "Maciej W. Rozycki" <>, "Kevin D. Kissell" <>,
Original-recipient: rfc822;
References: <> <>
User-agent: Mutt/1.4i
On Wed, Oct 16, 2002 at 02:20:42PM +0200, Maciej W. Rozycki wrote:
>  It also introduces an indirect call (jump?) overhead.  Anyway, you don't
> need to sacrifice anything.  We may simply assume the universally
> compatible way is the R3k one (be it sysmips() or whatever, if it gets
> replaced).  Then there is the branch-likely way, which requires
> branch-likely support (thus excludes R3k-class processors).  Then there is
> the ll/sc way, which requires ll/sc (thus excludes R3k-class processors
> and ones that lack the ll/sc instructions).  And you select the minimum
> set of features required at the build time. 

sysmips is history with current glibc since the Linux kernel emulates
LL/SC for CPUs that don't have it. This emulation is actually faster than
sysmips. (You'd think it's slower because it's one syscall vs. two
emulated instructions. But with LL/SC glibc can use test-and-set
which enables a more efficient linux-threads mutex implementation.)

AFAIK, current Linux distributions based on glibc-2.2.5 were built for
R3K be default and thus used sysmips even on platforms which have

> > But all that is of interest only, if VR41XX-like platforms
> > would use a glibc from a binary distribution like RedHat or
> > Debian (I use Debian for development, but have a custom
> > compiled glibc for production use).
>  I wouldn't care of distributions -- if one really needs optimized
> binaries it may make them be build somehow (either by doing the task
> oneself or by convincing someone else).

OK, that simplifies the issue. I will prepare a patches for
Linux and glibc.


<Prev in Thread] Current Thread [Next in Thread>