From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932425AbbFBP1D (ORCPT ); Tue, 2 Jun 2015 11:27:03 -0400 Received: from casper.infradead.org ([85.118.1.10]:58149 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932266AbbFBP0y (ORCPT ); Tue, 2 Jun 2015 11:26:54 -0400 Date: Tue, 2 Jun 2015 17:26:48 +0200 From: Peter Zijlstra To: Paul McKenney Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, laijs@cn.fujitsu.com, linux-kernel@vger.kernel.org Subject: [RFC][PATCH] rcu: Use WRITE_ONCE in RCU_INIT_POINTER Message-ID: <20150602152648.GT3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the paranoid amongst us GCC would be in its right to use byte stores to write our NULL value, tell it not to do that. Signed-off-by: Peter Zijlstra (Intel) --- include/linux/rcupdate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 33a056bb886f..e173847b6543 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -1046,7 +1046,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) #define RCU_INIT_POINTER(p, v) \ do { \ rcu_dereference_sparse(p, __rcu); \ - p = RCU_INITIALIZER(v); \ + WRITE_ONCE(p, RCU_INITIALIZER(v)); \ } while (0) /**