From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756039AbcH1SAy (ORCPT ); Sun, 28 Aug 2016 14:00:54 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34252 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755978AbcH1SAw (ORCPT ); Sun, 28 Aug 2016 14:00:52 -0400 Subject: Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h To: paulmck@linux.vnet.ibm.com References: <1472385376-8801-1-git-send-email-manfred@colorfullife.com> <1472385376-8801-2-git-send-email-manfred@colorfullife.com> <1472385376-8801-3-git-send-email-manfred@colorfullife.com> <20160828134321.GC19706@linux.vnet.ibm.com> Cc: benh@kernel.crashing.org, Ingo Molnar , Boqun Feng , Peter Zijlstra , Andrew Morton , LKML , 1vier1@web.de, Davidlohr Bueso From: Manfred Spraul Message-ID: Date: Sun, 28 Aug 2016 20:00:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160828134321.GC19706@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/28/2016 03:43 PM, Paul E. McKenney wrote: > >> Without the smp_mb__after_unlock_lock(), other CPUs can observe the >> write to d without seeing the write to a. >> >> Signed-off-by: Manfred Spraul > With the upgraded commit log, I am OK with the patch below. Done. > However, others will probably want to see at least one use of > smp_mb__after_unlock_lock() outside of RCU. I would look at it from the other side: There are at least half a dozen hardware/spinlock implementations that must support rcu. And for half a dozen implementations, a global header file makes sense, regardless of the number of users. With this in the global header file > #ifndef complex_memory_barrier() > #define complex_memory_barrier() always_safe_fallback() > #endif it is easier for the architectures to support rcu, ipc/sem and nf_conntrack. Especially if everything is (as it is now) in -- Manfred