Subject: Re: Restartable Atomic Sequences
To: Simon Burge <simonb@wasabisystems.com>
From: Gregory McGarry <g.mcgarry@ieee.org>
List: tech-kern
Date: 08/27/2002 15:09:32
Simon Burge wrote:
> Here's results for a couple of MIPS cpus:
>
> bcm1250 (mips64 500MHz)
>
> syscall lock: time= 7.174320
> RAS lock: time= 0.220124
> test-and-set lock: time= 0.450196
>
> au1000 (mips32 396MHz)
>
> syscall lock: time=12.292677
> RAS lock: time= 0.227705
> test-and-set lock: time= 0.531112
>
> r4400 (mips3 120MHz)
>
> syscall lock: time=48.880966
> RAS lock: time= 1.048473
> test-and-set lock: time= 1.090512
Great! I suspected it would be good on mips. Maybe all
register argument-passing CPUs.
> So RAS is faster in all cases. I'm thinking of something like:
>
> if sysctl(hw.ncpus == 1) {
> RAS lock
> } else {
> if (sysctl(machdep.llsc) {
> test-and-set lock
> } else {
> /* Eek! SMP without ll/sc */
> syscall lock
> }
> }
Yeah. This is what I did in the pthread library.
Thanks for the good news, Simon.
-- Gregory McGarry <g.mcgarry@ieee.org>