From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCHv5 2/2] memory barrier: adding smp_mb__after_lock Date: Fri, 3 Jul 2009 11:06:06 +0200 Message-ID: <20090703090606.GA3902@elte.hu> References: <20090703081219.GE2902@jolsa.lab.eng.brq.redhat.com> <20090703081445.GG2902@jolsa.lab.eng.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, fbl@redhat.com, nhorman@redhat.com, davem@redhat.com, htejun@gmail.com, jarkao2@gmail.com, oleg@redhat.com, davidel@xmailserver.org, eric.dumazet@gmail.com To: Jiri Olsa , Peter Zijlstra , Mathieu Desnoyers Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:59293 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbZGCJGW (ORCPT ); Fri, 3 Jul 2009 05:06:22 -0400 Content-Disposition: inline In-Reply-To: <20090703081445.GG2902@jolsa.lab.eng.brq.redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: * Jiri Olsa wrote: > +++ b/arch/x86/include/asm/spinlock.h > @@ -302,4 +302,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) > #define _raw_read_relax(lock) cpu_relax() > #define _raw_write_relax(lock) cpu_relax() > > +/* The {read|write|spin}_lock() on x86 are full memory barriers. */ > +#define smp_mb__after_lock() do { } while (0) Two small stylistic comments, please make this an inline function: static inline void smp_mb__after_lock(void) { } #define smp_mb__after_lock (untested) > +/* The lock does not imply full memory barrier. */ > +#ifndef smp_mb__after_lock > +#define smp_mb__after_lock() smp_mb() > +#endif ditto. Ingo