Re: Why Semaphore Hardware-Dependent?
- From: David Howells <dhowells@xxxxxxxxxx>
- Date: Tue, 29 Aug 2006 19:56:52 +0100
Andi Kleen <ak@xxxxxxx> wrote:
BTW maybe it would be a good idea to switch the wait list to a hlist,
then the last user in the queue wouldn't need to
touch the cache line of the head. Or maybe even a single linked
list then some more cache bounces might be avoidable.
You need a list_head to get O(1) push at one end and O(1) pop at the other.
The poper should know its node address already because it's on its own stack.
No. The popper (__rwsem_do_wake) runs in the context of up_xxxx(), not
down_xxxx(). Remember: up() may need to wake up several processes if there's
a batch of readers at the front of the queue.
Remember also: rwsems, unlike mutexes, are completely fair.
In addition a singly-linked list makes interruptible ops non-O(1) also.
When they are interrupted I guess? Hardly a problem to make that slower.
Currently interruptible rwsems are not available, but that may change, and
whilst I agree making it slower probably isn't a problem, it's still a point
that has to be considered.
David
-
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/
- References:
- Re: Why Semaphore Hardware-Dependent?
- From: Andi Kleen
- Re: Why Semaphore Hardware-Dependent?
- From: Andi Kleen
- Re: Why Semaphore Hardware-Dependent?
- From: Christoph Lameter
- Re: Why Semaphore Hardware-Dependent?
- From: David Howells
- Re: Why Semaphore Hardware-Dependent?
- Prev by Date: Re: 0x7f in SectorIdNotFound errors
- Next by Date: Re: [2.6.18-rc* PATCH RFC]: Correct ambiguous errno of aio
- Previous by thread: Re: Why Semaphore Hardware-Dependent?
- Next by thread: Re: [irda-users] [PATCH] OMAP: Add support for IrDA driver #2
- Index(es):
Relevant Pages
|