Subject: Re: Restartable Atomic Sequences
To: Simon Burge <simonb@wasabisystems.com>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 08/26/2002 19:51:41
On Tue, Aug 27, 2002 at 12:42:18PM +1000, Simon Burge wrote:
> 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
> }
> }
It would probably be reasonable to make the use of RAS the default
on *all* platforms, if there is only one CPU.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>