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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...>, Paul E. McKenney <paulmck@...>, Jeremy Fitzhardinge <jeremy@...>, Andrew Morton <akpm@...>, Ingo Molnar <mingo@...>, Joe Perches <joe@...>, <linux-kernel@...>, Steven Rostedt <rostedt@...>
Date: Thursday, August 21, 2008 - 5:26 pm

Linus Torvalds wrote:

First of all, let me say I don't pretend to understand formally how you 
deal with overflow-after-the-fact, as unlikely as it is.

However, it seems to me to be an easy way to avoid it.  Simply by 
changing the read-test mask to $0x80000003, you will kick the code down 
the slow path once the read counter reaches $0x80000004 (2^29+1 
readers), where you can do any necessary fixup -- or BUG() -- at leisure.

This fastpath ends up being identical in size and performance to the one 
you posted, although yours could be reduced by changing the test to a 
testb instruction -- at the almost certainly unacceptable expense of 
taking a partial-register stall on the CPUs that have those.

	-hpa
--
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)