On Thu, Mar 02, 2006 at 10:06:50AM -0800, Linus Torvalds wrote:
>
>
> On Thu, 2 Mar 2006, Andi Kleen wrote:
> >
> > That would be spinlock nesting of 2 per CPU on a 1024 CPU machine.
> > Not exactly plenty. Better 12-14 at least.
>
> That's PLENTY.
>
> First off, name somebody who sells bigger systems than that.
>
> Second, taking two spinlocks per CPU is crazy in the first place. Who does
> that? Talk about scaling badly.
Nobody does that - it was a purely hypothetical question. The algorithm
needs to lock out all the per-cpu counters while state transitions occur
(i.e. does global manipulations of the counters).
> Third, code that cares can avoid it entirely by just bumping the preempt
> counter _once_, and then using the raw spinlock code. That's how you
> should do it for big-rw-locks anyway, just because it's less insane, if
> that is what XFS is doing with its "two spinlocks per CPU" thing.
Exactly the change I made, except it uses an atomic bit field and ndelay
rather than raw spinlocks. Spinlocks were a bad choice in the first
place because I was not aware of the counter overflow problem.
Cheers,
Dave.
--
Dave Chinner
R&D Software Enginner
SGI Australian Software Group
|