From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117AbbKLShG (ORCPT ); Thu, 12 Nov 2015 13:37:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58837 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932076AbbKLShC (ORCPT ); Thu, 12 Nov 2015 13:37:02 -0500 Date: Thu, 12 Nov 2015 20:33:02 +0100 From: Oleg Nesterov To: Peter Zijlstra Cc: Boqun Feng , mingo@kernel.org, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, corbet@lwn.net, mhocko@kernel.org, dhowells@redhat.com, torvalds@linux-foundation.org, will.deacon@arm.com, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Subject: Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Message-ID: <20151112193302.GA9988@redhat.com> References: <20151102134941.005198372@infradead.org> <20151103175958.GA4800@redhat.com> <20151111093939.GA6314@fixme-laptop.cn.ibm.com> <20151111121232.GN17308@twins.programming.kicks-ass.net> <20151111193953.GA23515@redhat.com> <20151112070915.GC6314@fixme-laptop.cn.ibm.com> <20151112150058.GA30321@redhat.com> <20151112151839.GE6314@fixme-laptop.cn.ibm.com> <20151112183807.GA7538@redhat.com> <20151112180203.GF17308@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151112180203.GF17308@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12, Peter Zijlstra wrote: > > On Thu, Nov 12, 2015 at 07:38:07PM +0100, Oleg Nesterov wrote: > > It seems that PPC needs to define smp_mb__before_spinlock() as full mb(), > > no? > > It does: > > arch/powerpc/include/asm/barrier.h:#define smp_mb__before_spinlock() smp_mb() Ah, indeed, thanks. And given that it also defines smp_mb__after_unlock_lock() as smp_mb(), I am starting to understand how it can help to avoid the races with spin_unlock_wait() in (for example) do_exit(). But as Boqun has already mentioned, this means that mb__after_unlock_lock() has the new meaning which should be documented. Hmm. And 12d560f4 "Privatize smp_mb__after_unlock_lock()" should be reverted then ;) Oleg.