[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071201010752.GA26621@gondor.apana.org.au>
Date: Sat, 1 Dec 2007 12:07:52 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, ego@...ibm.com,
netdev@...r.kernel.org, bridge@...ts.osdl.org, devel@...nvz.org,
shemminger@...ux-foundation.org, xemul@...nvz.org,
dipankar@...ibm.com, akpm@...ux-foundation.org
Subject: Re: [PATCH] Remove rcu_assign_pointer() penalty for NULL pointers
On Fri, Nov 30, 2007 at 04:37:21PM -0800, Paul E. McKenney wrote:
>
> The rcu_assign_pointer() primitive currently unconditionally executes
> a memory barrier, even when a NULL pointer is being assigned. This
> has lead some to avoid using rcu_assign_pointer() for NULL pointers,
> which loses the self-documenting advantages of rcu_assign_pointer()
> This patch uses __builtin_const_p() to omit needless memory barriers
> for NULL-pointer assignments at compile time with no runtime penalty,
> as discussed in the following thread:
>
> http://www.mail-archive.com/netdev@vger.kernel.org/msg54852.html
>
> Tested on x86_64 and ppc64, also compiled the four cases (NULL/non-NULL
> and const/non-const) with gcc version 4.1.2, and hand-checked the
> assembly output.
>
> Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Acked-by: Herbert Xu <herbert@...dor.apana.org.au>
Thanks a lot for following through with this Paul!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists