Received: by 10.213.65.68 with SMTP id h4csp224483imn; Wed, 28 Mar 2018 02:19:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/LlxUZFXPhmaifEOeL7rRUxgPuq/1ZU5C+92rXWz9KID5r5SRKHYAkGvbsy1E28zMkLKzA X-Received: by 2002:a17:902:a713:: with SMTP id w19-v6mr2905367plq.246.1522228749855; Wed, 28 Mar 2018 02:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522228749; cv=none; d=google.com; s=arc-20160816; b=DUSMSwT81SvHtqskeZVP8XJsq4OXk/0tyrfx4d5uOfzJw12EtyE6Vz1MXJ9awMZZdS DFe9v1gaYaUBTuh3th6x9f9jcpM4Yr7QoGOQOWNIhwnP/dt3YW9viJhnZUJx1/R73RpW +mU5rutVH7WVcPc6zJDX46aiyg4W8soCJIholBF0UZkSGVAY5t9x8+H7XxzQu8TTnREO rsWElUqaTVp/hiMIBCUTfEO2aUdQEveLJyhwIM50TpctoBiz1Jx7e1mDc2XFW03J2Dkc AEsVucZTGB5L3WL2hntpXcEgFVrKnCU1JjnCOwdqTKFlWca271QWUCPjkA8E9VO1wket E7Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=sxqqegSUoeYJt9TTGJJ35zwntp9Ca9ypU4AJnPq5Be4=; b=sZhfoQwPantajdPaDowu1/X+yASuKIeuvigeUVoTIc47l9EQH2b/WZgLIq1XeWtH67 K2pIYNYKcrP+xEq+Og+nU+gjDegLNDNezsnUXpgJeromEMVVvY4ymZBM+cq49DS6iPSw 2luOslsVJRDALifTwPfWM3nAMj4XaNMKHIet/TxUMd6IMXSKu5qJLZPsAfQCSx2rD34W 4q6WA7nwm48dKZTiQzQW2SVhu39ohHJqeX1AODN22AkVlnCHXS30BzAr5K59NO+MJOIc IpYy3O0VQVDfTmoZHFLOilzAtcEsFlm0xVv9y2Oh4Z1BpV0XjSKJP3BvwVX+HRJnt3wJ kr1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DE2rRacN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si2154822pgr.471.2018.03.28.02.18.55; Wed, 28 Mar 2018 02:19:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DE2rRacN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752296AbeC1JRt (ORCPT + 99 others); Wed, 28 Mar 2018 05:17:49 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35834 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbeC1JRr (ORCPT ); Wed, 28 Mar 2018 05:17:47 -0400 Received: by mail-wm0-f67.google.com with SMTP id r82so3853628wme.0 for ; Wed, 28 Mar 2018 02:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sxqqegSUoeYJt9TTGJJ35zwntp9Ca9ypU4AJnPq5Be4=; b=DE2rRacNTr6iCT6ovEOgueydMUaqOYw5R9LX4QlPoIH0UFOCy0o0yRZKOK+uTjNWHt 4vLei3xToQ9sQl0oUmb8y2DFW5SvjyHXsFUAxUOEddfKuumtcebH9U5hjmZCrrk/+ID7 hK6eyMGf/SMLfusiwdsJvJHFMOdLkQ1VHi9uA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sxqqegSUoeYJt9TTGJJ35zwntp9Ca9ypU4AJnPq5Be4=; b=V3osda3LeRWLnLWBwi2kUrHSKTOAXS3HLpAcS9irmCWomumpWuHBZD0EN2W5s1rTzI Q3sFcts5Vhb9YHu0XLN+GLEgVIhQmrnoG0THuwhEynS/PkEHb9guS2GybXwhNg5OFXim 2IZbXFKNFfjMYAZhf4Pu1pDQOBIhjJVDWwv1xhdo7MR2phaMia6GTrdVKf4s+4/LVOrH 2+JO7Iyey+kCI2p84O+v6xGQmolvj88RD8WHvLPBxcZAqB1nQEf5tHFNeNB2zQWTmkie 4eUWkCMZuzfwAuXS0ELB6FYLg/t5keSkFCbOuXLFk6ac9r4+tR1MUgpXYgMtInaEI1tX Ir7A== X-Gm-Message-State: AElRT7H8aaDrvzQnszYjhLIw0NA6wXp1kl+kIAmrJu1SAIvlDEsBoEJ6 3cq36GmQRDTe3MLGX4EpjQeX6w== X-Received: by 10.28.141.138 with SMTP id p132mr2070021wmd.51.1522228666082; Wed, 28 Mar 2018 02:17:46 -0700 (PDT) Received: from andrea ([213.209.242.222]) by smtp.gmail.com with ESMTPSA id x67sm6439693wma.23.2018.03.28.02.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 02:17:45 -0700 (PDT) Date: Wed, 28 Mar 2018 11:17:36 +0200 From: Andrea Parri To: Benjamin Herrenschmidt Cc: Paul Mackerras , Michael Ellerman , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH for-4.17 2/2] powerpc: Remove smp_mb() from arch_spin_is_locked() Message-ID: <20180328091736.GA30906@andrea> References: <1522060667-7034-1-git-send-email-andrea.parri@amarulasolutions.com> <1522109216.7364.30.camel@kernel.crashing.org> <20180327102521.GA7347@andrea> <1522150386.7364.53.camel@kernel.crashing.org> <20180327131339.GA4278@andrea> <1522187495.7364.70.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522187495.7364.70.camel@kernel.crashing.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 28, 2018 at 08:51:35AM +1100, Benjamin Herrenschmidt wrote: > On Tue, 2018-03-27 at 15:13 +0200, Andrea Parri wrote: > > > > > > So unless it's very performance sensitive, I'd rather have things like > > > spin_is_locked be conservative by default and provide simpler ordering > > > semantics. > > > > Well, it might not be "very performance sensitive" but allow me to say > > that "40+ SYNCs in stuff like BUG_ON or such" is sadness to my eyes ;), > > In the fast path or the trap case ? Because the latter doesn't matter > at all... Both: you must execute the sync "before" issuing the load of lock.slock. > > > especially when considered that our "high level API" provides means to > > avoid this situation (e.g., smp_mb__after_spinlock(); BTW, if you look > > at architectures for which this macro is "non-trivial", you can get an > > idea of the architectures which "wouldn't work"; of course, x86 is not > > among these). Yes, we do appear to have different views on what is to > > be considered the "simpler ordering semantics". I'm willing to change > > mine _as soon as_ this gets documented: would you be willing to send a > > patch (on the lines of my [1]) to describe/document such semantics? > > Not really :-) Just expressing an opinion. I don't fully object to your > approach, just saying it's open for debate. Always (open for debate). I'm sending a v2 of this series shortly, integrating some feedback; I prefer to keep this patch in the series (feel free to ignore). Andrea > > At this point, I have too many other things to chase to follow up too > much on this. > > Cheers, > Ben. >