Re: [git pull] scheduler fixes

From: Linus Torvalds
Date: Tue May 13 2008 - 13:23:40 EST




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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/