Received: by 10.213.65.68 with SMTP id h4csp327568imn; Wed, 28 Mar 2018 04:30:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CNWQL55jV38j0qA0+5NoGO9nOM11qrgo0pNFSs3gJjQ9YvPInu30rClcBb0hHkvamVJcH X-Received: by 2002:a17:902:9694:: with SMTP id n20-v6mr3389362plp.397.1522236627587; Wed, 28 Mar 2018 04:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522236627; cv=none; d=google.com; s=arc-20160816; b=zbxbGvwbPByxu1IfUXywYDVG/CWxRySUogLT8Ck73RbpuVz19sIABgxzWmid8t4AAx 0HE9FXtDcQR8SrlXxkWuS2vOcnaKacmPtl+h7Q9D09nQ282J9VKzIMwTakwDRmB+SQPl aY5YTQW9dlpAdiz04Dg1WKblxAv4od2Cs8wniS0KkQAtfsWFFJ4EfiF/JVpGKiN7dpjc kHuyyLlg42nO2uyQqBALXIL8VrYVvBQ6mbfMvY9F6YkaXFlEafDB2IY2sBVVPIYijwur q8qkWMrH6M+3ySoRVLWdfm2Al26Li7on4Mf0p1+EcXZ+vlJFA+XJgGQtw7N0UCuRRToC 2GwQ== 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=2SWSwbCEPJmy7PPosxZddpz8kLGMLBprUWb0YkGlA+U=; b=nxhFO3SeaO7N9cW0VfyxxpT5Y3x+kSBMYfhIaoDa9rbn+prcGwNmsPDb3vOydr0D5R gDVqK0zfoXpbw+97AUpAL5skWdfuVB2PowAz5QcrhUuV0FPwK//2Q7DpnEPrzrz1/eZ9 IFySMwhh+PeXSGoS1VudHYokW95/y3lwBBKWahgKYMQE0qbkPYXQYy2Ifa2zu1rEzCyj ygGy3D10c+xPqb8FKbUJTeSBRcL2++cT7wipeTR92CWKNKrSJLV50K4jHpMFeXottn9/ Z3BW7z+wHMj+pOVCYiWnF3QUX8QMQEVpvNQj1J5WkS4Brm/FphabXbqg1FqBHVk9P0YL OTDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=0GS15lVL; 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 c12si2365601pgv.110.2018.03.28.04.30.13; Wed, 28 Mar 2018 04:30:27 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=0GS15lVL; 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 S1752667AbeC1LE7 (ORCPT + 99 others); Wed, 28 Mar 2018 07:04:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54336 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751209AbeC1LE6 (ORCPT ); Wed, 28 Mar 2018 07:04:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2SWSwbCEPJmy7PPosxZddpz8kLGMLBprUWb0YkGlA+U=; b=0GS15lVLXKS6+KfGPeGzWf/DU hY+dGISiRMQRI/EzpFHYtx86XX96HT4qQfkqmdd5knCTWD4J1PkJ+IwBKd5J3YF3wSX5FpsWcwBqd Hke58RLEhuUqR1M71r24sQ5yPTSA0N4Qf6AGT4qqblXezo7x5dlRHsfiOAl1yGOa3cTLqVLZDRXCV GpiilMHA009+LHGLT0sdHR++Z6OqVgRq7fQF9+VChc3lmxEKB2e0LDc0hLxmkxjA8yCpXG5mf+P/5 JqJ1LoLV+vTi3GzXHbMVFoEUX9F7e+opP+MY53TDByi3gcD8+PFMGg7kBWcP0j0FOwqtNjch8B5eP H+iY/iqJQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f18sh-0001nz-2P; Wed, 28 Mar 2018 11:04:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 81781202A4A09; Wed, 28 Mar 2018 13:04:36 +0200 (CEST) Date: Wed, 28 Mar 2018 13:04:36 +0200 From: Peter Zijlstra To: Michael Ellerman Cc: Andrea Parri , Benjamin Herrenschmidt , Paul Mackerras , 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: <20180328110436.GR4043@hirez.programming.kicks-ass.net> References: <1522060667-7034-1-git-send-email-andrea.parri@amarulasolutions.com> <1522109216.7364.30.camel@kernel.crashing.org> <20180327102521.GA7347@andrea> <87a7us3h66.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a7us3h66.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.9.3 (2018-01-21) 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 04:25:37PM +1100, Michael Ellerman wrote: > That was tempting, but it leaves unfixed all the other potential > callers, both in in-tree and out-of-tree and in code that's yet to be > written. So I myself don't care one teeny tiny bit about out of tree code, they get to keep their pieces :-) > Looking today nearly all the callers are debug code, where we probably > don't need the barrier but we also don't care about the overhead of the > barrier. Still, code like: WARN_ON_ONCE(!spin_is_locked(foo)); will unconditionally emit that SYNC. So you might want to be a little careful. > Documenting it would definitely be good, but even then I'd be inclined > to leave the barrier in our implementation. Matching the documented > behaviour is one thing, but the actual real-world behaviour on well > tested platforms (ie. x86) is more important. By that argument you should switch your spinlock implementation to RCpc and include that SYNC in either lock or unlock already ;-) Ideally we'd completely eradicate the *_is_locked() crud from the kernel, not sure how feasable that really is, but it's a good goal. At that point the whole issue of the barrier becomes moot of course.