Re: [git pull] scheduler fixes

Linus Torvalds
2008-05-13T17:23:39Z

On Tue, 13 May 2008, Ingo Molnar wrote:
>
> hm, this sounds like damage that is inflicted on itself by the XFS code.

No. You're confusing what a counting semaphore is.

> Why does it signal to its waiters that "resource is available", when in
> reality that resource is not available but immediately serialized via a
> lock? (even if the lock might technically be some _other_ object)

So you have 'n' resources available, and you use a counting semaphore for
that resource counting.

But you'd still need a spinlock to actually protect the list of resources
themselves. The spinlock protects a different thing than the semaphore.
The semaphore isn't about mutual exclusion - it's about counting resources
and waiting when there are too many things in flight.

And you seem to think that a counting semaphore is about mutual exclusion.
It has nothing what-so-ever to do with that.

Linus