Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Herbert Xu <herbert@...>
Cc: <mingo@...>, <jolsa@...>, <a.p.zijlstra@...>, <netdev@...>, <linux-kernel@...>, <fbl@...>, <nhorman@...>, <davem@...>, <htejun@...>, <jarkao2@...>, <oleg@...>, <davidel@...>, <eric.dumazet@...>, <Paul.McKenney@...>
Date: Friday, July 3, 2009 - 11:40 am

* Herbert Xu (herbert@gondor.apana.org.au) wrote:

I guess you are proposing migration from rwlock to RCU ?

Well, in cases where critical sections are in the order of 20000
cycles or more, and with 8 to 64-core machines, there is no significant
gain in using RCU vs rwlocks, so the added complexity might not be
justified if the critical sections are very long.

But then it's a case by case thing. We would have to see what exactly is
protected by this read lock and how long the critical section is.
However, in any case, you are right: rwlocks are acceptable only for
long critical sections, for which we just don't care about one extra
memory barrier.

Instead of optimizing away these read-side rwlock barriers, we would
spend our time much more efficiently switching to RCU read side.

Mathieu


-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHv5 0/2] net: fix race in the receive/select, Jiri Olsa, (Fri Jul 3, 4:12 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Fri Jul 3, 10:04 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Fri Jul 3, 11:40 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Fri Jul 3, 11:47 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Paul E. McKenney, (Fri Jul 3, 1:06 pm)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Fri Jul 3, 1:31 pm)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Tue Jul 7, 10:01 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Tue Jul 7, 10:57 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Tue Jul 7, 11:04 am)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Tue Jul 7, 3:45 pm)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Tue Jul 7, 7:28 pm)
Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock, Mathieu Desnoyers, (Wed Jul 8, 12:34 am)