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: Eric Dumazet <eric.dumazet@...>
Cc: Jiri Olsa <jolsa@...>, Ingo Molnar <mingo@...>, Peter Zijlstra <a.p.zijlstra@...>, <netdev@...>, <linux-kernel@...>, <fbl@...>, <nhorman@...>, <davem@...>, <htejun@...>, <jarkao2@...>, <oleg@...>, <davidel@...>
Date: Tuesday, July 7, 2009 - 10:57 am

* Eric Dumazet (eric.dumazet@gmail.com) wrote:

OK


Yep, I can understand that. Tbench on localhost is an especially good
benchmark for this ;)


Well, I see the __read_lock()+2x smp_mb+__read_unlock is not well suited
for x86. You're right.

But read_lock + smp_mb__after_lock + read_unlock is not well suited for
powerpc, arm, mips and probably others where there is an explicit memory
barrier at the end of the read lock primitive.

One thing that would be efficient for all architectures is to create a
locking primitive that contains the smp_mb, e.g.:

read_lock_smp_mb()

which would act as a read_lock which does a full smp_mb after the lock
is taken.

The naming may be a bit odd, better ideas are welcome.

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)