From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907AbdHJJN0 (ORCPT ); Thu, 10 Aug 2017 05:13:26 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36234 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbdHJJNY (ORCPT ); Thu, 10 Aug 2017 05:13:24 -0400 Date: Thu, 10 Aug 2017 11:13:17 +0200 From: Peter Zijlstra To: Boqun Feng Cc: Waiman Long , Ingo Molnar , linux-kernel@vger.kernel.org, Pan Xinhui , Andrea Parri , Will Deacon , Paul McKenney Subject: Re: [RESEND PATCH v5] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs Message-ID: <20170810091317.hv6smfz5fxgolu2n@hirez.programming.kicks-ass.net> References: <1495633108-12818-1-git-send-email-longman@redhat.com> <20170809150603.6z43zkxnz3hew3jb@hirez.programming.kicks-ass.net> <20170809151533.ipzeu7vmwi5ttcab@hirez.programming.kicks-ass.net> <20170810081213.wtd7hgunnnekvm56@tardis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170810081213.wtd7hgunnnekvm56@tardis> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 10, 2017 at 04:12:13PM +0800, Boqun Feng wrote: > > Or is the reason this doesn't work on PPC that its RCpc? So that :-) > Here is an example why PPC needs a sync() before the cmpxchg(): > > https://marc.info/?l=linux-kernel&m=144485396224519&w=2 > > and Paul Mckenney's detailed explanation about why this could happen: > > https://marc.info/?l=linux-kernel&m=144485909826241&w=2 > > (Somehow, I feel like he was answering to a similar question question as > you ask here ;-)) Yes, and I had vague memories of having gone over this before, but couldn't quickly find things. Thanks! > And I think aarch64 doesn't have a problem here because it is "(other) > multi-copy atomic". Will? Right, its the RCpc vs RCsc thing. The ARM64 release is as you say multi-copy atomic, whereas the PPC lwsync is not. This still leaves us with the situation that we need an smp_mb() between smp_store_release() and a possibly failing cmpxchg() if we want to guarantee the cmpxchg()'s load comes after the store-release.