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

* Oleg Nesterov (oleg@redhat.com) wrote:

Yep, agreed that it also sounds like added complexity in locking rules,
and I've not yet seen the benefit of it.


Because adding smp_mb__after_lock() is _only_ useful on x86. Most other
architectures _will_ suffer from a performance degradation, unless you
implement the __read_lock_noacquire.


I fully agree with the bugfix.


Given we can later build around the smp__mb_after_lock() to eliminate the
performance deterioration on non-x86 architectures by adding a
__read_lock_noacquire() primitive, I guess this can be done in a later
phase as an optimization.

I do not care if performance are not perfect for all architectures at
this point. What I really care about is that we do not introduce new
locking, atomic ops or memory barrier semantics that only make sense
for a single architecture and limit others.

Given that we can eventually move to a
__read_lock_noacquire()/smp_mb__after_lock() scheme, then adding just
smp_mb__after_lock() in the first place does not seem like a bad move.
It will just degrade performance of non-x86 architectures until
__read_lock_noacquire() or something similar comes.

So it looks fine if the code path is critical enough to justify adding
such new memory barrier. As long as we don't end up having
smp_mb__after_ponies().

Cheers,

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)