Re: [RFC][PATCH RT] rwsem_rt: Another (more sane) approach to mulit reader rt locks
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2012-05-15 17:43:18
Also in:
lkml
On Tue, 2012-05-15 at 19:31 +0200, Peter Zijlstra wrote:
On Tue, 2012-05-15 at 13:25 -0400, Steven Rostedt wrote:quoted
On Tue, 2012-05-15 at 11:42 -0400, Steven Rostedt wrote:quoted
On Tue, 2012-05-15 at 17:06 +0200, Peter Zijlstra wrote:quoted
On Tue, 2012-05-15 at 10:03 -0400, Steven Rostedt wrote:quoted
where readers may nest (the same task may grab the same rwsem for read multiple times), but only one task may hold the rwsem at any given time (for read or write).Humm, that sounds iffy, rwsem isn't a recursive read lock only rwlock_t is.In that case, current -rt is broken. As it has it being a recursive lock (without my patch).Nah not broken, just pointless. A recursive lock that's not used recursively is fine.
Heh, sure :-) But as -rt keeps it recursive, I didn't want to change that.
quoted
Why wouldn't it be recursive. If two different tasks are allowed to grab a read lock at the same time, why can't the same task grab a read lock twice? As long as it releases it the same amount of times. Now you can't grab a read lock if you have the write lock.rwsem is fifo-fair, if a writer comes in between the second read acquisition (even by the same task) would block and you'd be a deadlock since the write won't succeed since you're still holding a reader.
Yep agreed. And this patch didn't change that either. -- Steve