From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757189AbcH2Ks3 (ORCPT ); Mon, 29 Aug 2016 06:48:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:39562 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750860AbcH2Ks2 (ORCPT ); Mon, 29 Aug 2016 06:48:28 -0400 Date: Mon, 29 Aug 2016 12:48:15 +0200 From: Peter Zijlstra To: Manfred Spraul Cc: benh@kernel.crashing.org, paulmck@linux.vnet.ibm.com, Ingo Molnar , Boqun Feng , Andrew Morton , LKML , 1vier1@web.de, Davidlohr Bueso Subject: Re: [PATCH 1/4] spinlock: Document memory barrier rules Message-ID: <20160829104815.GI10153@twins.programming.kicks-ass.net> References: <1472385376-8801-1-git-send-email-manfred@colorfullife.com> <1472385376-8801-2-git-send-email-manfred@colorfullife.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1472385376-8801-2-git-send-email-manfred@colorfullife.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 28, 2016 at 01:56:13PM +0200, Manfred Spraul wrote: > Right now, the spinlock machinery tries to guarantee barriers even for > unorthodox locking cases, which ends up as a constant stream of updates > as the architectures try to support new unorthodox ideas. > > The patch proposes to reverse that: > spin_lock is ACQUIRE, spin_unlock is RELEASE. > spin_unlock_wait is also ACQUIRE. > Code that needs further guarantees must use appropriate explicit barriers. > > Architectures that can implement some barriers for free can define the > barriers as NOPs. > > As the initial step, the patch converts ipc/sem.c to the new defines: > - no more smp_rmb() after spin_unlock_wait(), that is part of > spin_unlock_wait() > - smp_mb__after_spin_lock() instead of a direct smp_mb(). > Why? This does not explain why..