From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbdHOSkh (ORCPT ); Tue, 15 Aug 2017 14:40:37 -0400 Received: from foss.arm.com ([217.140.101.70]:56070 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbdHOSkg (ORCPT ); Tue, 15 Aug 2017 14:40:36 -0400 Date: Tue, 15 Aug 2017 19:40:35 +0100 From: Will Deacon To: Peter Zijlstra Cc: Waiman Long , Ingo Molnar , linux-kernel@vger.kernel.org, Pan Xinhui , Boqun Feng , Andrea Parri , Paul McKenney Subject: Re: [RESEND PATCH v5] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs Message-ID: <20170815184034.GD10801@arm.com> References: <1495633108-12818-1-git-send-email-longman@redhat.com> <20170810115034.ie65wfxepiq6noew@hirez.programming.kicks-ass.net> <945c28c3-5779-c8c8-13bb-40477abd1f0e@redhat.com> <20170810161524.2wzocpcxrliy7nt6@hirez.programming.kicks-ass.net> <7cb318a8-d5b9-0019-a537-1720fc5222cc@redhat.com> <73daa6e6-537e-b0ce-e1e0-7afa75334509@redhat.com> <20170811090601.2owslxi4lgv3kond@hirez.programming.kicks-ass.net> <20170814120121.GA24249@arm.com> <20170814184711.GL6524@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170814184711.GL6524@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 14, 2017 at 08:47:11PM +0200, Peter Zijlstra wrote: > On Mon, Aug 14, 2017 at 01:01:22PM +0100, Will Deacon wrote: > > Yeah, that's right, you can't use the STXR status flag to create control > > dependencies. > > Just for my elucidation; you can't use it to create a control dependency > on the store, but you can use it to create a control dependency on the > corresponding load, right? Hmm, sort of, but I'd say that the reads are really ordered due to read-after-read ordering in that case. Control dependencies to loads don't give you order. > Now, IIRC, we've defined control dependencies as being LOAD->STORE > ordering, so in that respect nothing is lost. But maybe we should > explicitly mention that if the LOAD is part of an (otherwise) atomic RmW > the STORE is not constrained. I could well be misreading your suggestion, but it feels like that's too weak. You can definitely still have control dependencies off the LL part of the LL/SC pair, just not off the SC part. E.g. this version of LB is forbidden on arm64: P0: if (atomic_inc_return_relaxed(&x) == 2) atomic_set(&y, 1); P1: if (atomic_inc_return_relaxed(&y) == 2) atomic_set(&x, 1); Perhaps when you say "the STORE", you mean the store in the atomic RmW, rather than the store in the LOAD->STORE control dependency? Will