Re: [RFC PATCH] Writer-biased low-latency rwlock v8

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mathieu Desnoyers <mathieu.desnoyers@...>
Cc: Paul E. McKenney <paulmck@...>, H. Peter Anvin <hpa@...>, Jeremy Fitzhardinge <jeremy@...>, Andrew Morton <akpm@...>, Ingo Molnar <mingo@...>, Joe Perches <joe@...>, <linux-kernel@...>, Steven Rostedt <rostedt@...>
Date: Saturday, August 23, 2008 - 5:40 pm

On Sat, 23 Aug 2008, Mathieu Desnoyers wrote:

EXACTLY.

It's not even necessarily a "contention" bit per se - it's literally a 
"readers have to take the slow-path" bit (writers will obviously _always_ 
take the slowpath if there is any non-zero value at all, so they don't 
need it).

Then, the slow-path might actually decide that "hey, there is no _actual_ 
writer there yet - just some _waiting_ writer, but since this read lock is 
in an interrupt context, we have to let it go through _despite_ the fact 
that the lock is contended in order to avoid deadlock".

So it allows a fast-path for the trivial cases that is literally just a 
couple of instructions long, and that is nice not just because of 
performance issues, but because it then means that you can entirely ignore 
all those things in the slow path. It also means that everybody can look 
at the fast-path and decide that "ok, the fast-path really is optimal". 

That fast-path is what a lot of people care more about than just about 
anything else.

The slow-path, in comparison, can be in C, and can do all those checks 
like "are we in an (sw-)interrupt handler?" and basically prioritize 
certain classes of people.

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86_64 : support atomic ops with 64 bits integer val..., Mathieu Desnoyers, (Sat Aug 16, 3:39 am)
Re: [PATCH] x86_64 : support atomic ops with 64 bits integer..., Mathieu Desnoyers, (Sat Aug 16, 11:43 am)
[RFC PATCH] Fair rwlock, Mathieu Desnoyers, (Sat Aug 16, 5:19 pm)
Re: [RFC PATCH] Fair rwlock, Linus Torvalds, (Sat Aug 16, 5:33 pm)
[RFC PATCH] Fair low-latency rwlock v3, Mathieu Desnoyers, (Sun Aug 17, 3:53 am)
Re: [RFC PATCH] Fair low-latency rwlock v3, Linus Torvalds, (Sun Aug 17, 12:17 pm)
[RFC PATCH] Fair low-latency rwlock v5, Mathieu Desnoyers, (Sun Aug 17, 3:10 pm)
Re: [RFC PATCH] Fair low-latency rwlock v5, Peter Zijlstra, (Mon Aug 25, 3:20 pm)
Re: [RFC PATCH] Fair low-latency rwlock v5, Paul E. McKenney, (Mon Aug 18, 7:25 pm)
Re: [RFC PATCH] Fair low-latency rwlock v5, Mathieu Desnoyers, (Tue Aug 19, 2:04 am)
Re: [RFC PATCH] Fair low-latency rwlock v5, Mathieu Desnoyers, (Tue Aug 19, 3:33 am)
Re: [RFC PATCH] Fair low-latency rwlock v5, Linus Torvalds, (Tue Aug 19, 12:48 pm)
[RFC PATCH] Writer-biased low-latency rwlock v8, Mathieu Desnoyers, (Thu Aug 21, 4:50 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Linus Torvalds, (Thu Aug 21, 5:00 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, H. Peter Anvin, (Thu Aug 21, 5:26 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Linus Torvalds, (Thu Aug 21, 5:41 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Linus Torvalds, (Thu Aug 21, 5:15 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Mathieu Desnoyers, (Sat Aug 23, 1:09 am)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Linus Torvalds, (Sat Aug 23, 2:02 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Mathieu Desnoyers, (Sat Aug 23, 4:30 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Linus Torvalds, (Sat Aug 23, 5:40 pm)
Re: [RFC PATCH] Writer-biased low-latency rwlock v8, Linus Torvalds, (Thu Aug 21, 6:22 pm)
Re: [RFC PATCH] Fair low-latency rwlock v5, Mathieu Desnoyers, (Tue Aug 19, 5:06 am)
Re: [RFC PATCH] Fair low-latency rwlock v5, Linus Torvalds, (Mon Aug 18, 2:59 pm)
Re: [RFC PATCH] Fair low-latency rwlock v5 (updated benchmar..., Mathieu Desnoyers, (Sun Aug 17, 5:30 pm)