Re: [PATCH RFC] big reader semaphore take#2

From: Nick Piggin
Date: Fri Nov 04 2005 - 20:27:19 EST


Tejun Heo wrote:
Nick Piggin wrote:

The upshot of that would be that you could build the whole thing
from rwsem infrastructure and have basically zero other locking
mechanisms or complexity that you don't want in a synchronisation
primitive.


To certain extent, I do agree with you - it's safer/simpler..., but on the other hand, new brsem isn't that more complex and would perform almost identically without extra semantical baggage. So, I thought it might be worth a bit more effort.


I would do it thisway if possible, yes.

Hmm... So, array of rwsem's, it should be.


First implementation would be per-cpu just rwsems. A second patch
to make it just an array rwsem->count's plus a shared queue may
be in order - OTOH everyone does their own rwsems, so this will be
a bit of a headache.

I forget - are you just planning to use one global brsem? In this
case the size issue wouldn't be a pressing one.

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com -
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/