From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752026AbbGMP4R (ORCPT ); Mon, 13 Jul 2015 11:56:17 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57460 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751438AbbGMP4P (ORCPT ); Mon, 13 Jul 2015 11:56:15 -0400 Date: Mon, 13 Jul 2015 17:56:06 +0200 From: Peter Zijlstra To: Will Deacon Cc: Peter Hurley , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Benjamin Herrenschmidt , Paul McKenney Subject: Re: [RFC PATCH v2] memory-barriers: remove smp_mb__after_unlock_lock() Message-ID: <20150713155606.GC19282@twins.programming.kicks-ass.net> References: <1436789704-10086-1-git-send-email-will.deacon@arm.com> <55A3B89E.7060708@hurleysoftware.com> <20150713142418.GF2632@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150713142418.GF2632@arm.com> 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 On Mon, Jul 13, 2015 at 03:24:18PM +0100, Will Deacon wrote: > On Mon, Jul 13, 2015 at 02:09:50PM +0100, Peter Hurley wrote: > > On 07/13/2015 08:15 AM, Will Deacon wrote: > > > smp_mb__after_unlock_lock is used to promote an UNLOCK + LOCK sequence > > > into a full memory barrier. > > > > > > However: > > > > > > - This ordering guarantee is already provided without the barrier on > > > all architectures apart from PowerPC > > > > > > - The barrier only applies to UNLOCK + LOCK, not general > > > RELEASE + ACQUIRE operations > > > > I'm unclear what you mean here: do you mean > > A) a memory barrier is not required between RELEASE M + ACQUIRE N when you > > want to maintain distinct order between those operations on all arches > > (with the possible exception of PowerPC), or, > > B) no one is using smp_mb__after_unlock_lock() in that way right now. > > My understanding is (B), but Peter and I don't seem to agree yet! > I'll tighten up the text once we reach a conclusion. I'm fairly sure (but I've not looked) that nobody does in fact rely on this. So I'm in agreement with B, and I'm quibbling on what exactly A means ;-)