Received: by 10.213.65.68 with SMTP id h4csp3572559imn; Tue, 3 Apr 2018 07:18:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+/SbZ4m/e+3lyAmq5D+cMXNVZp0MPPIFCEHoGPdnTa/mmInjVqZHkZLTmoTMIU78WQO7eA X-Received: by 10.101.102.2 with SMTP id w2mr9488315pgv.207.1522765080368; Tue, 03 Apr 2018 07:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522765080; cv=none; d=google.com; s=arc-20160816; b=ojFqLg5ZbD5No56w5nPdXUtxoZ3pYjrkOJkZHcONnYWKw8luHXb82OW22RC8LsYeRV DGj27Ybf/7H6yfmy5Dmtmca+vGhyGl3rA+YqYZHWN/obrRjko8Qp/WryF45eVt4Xt5ry VeHy9HBPDMKK8pJQEN8oDBR0LMWuXMImO8t2uaMMLSzFhhT+73jGsYw0ZYS6M0/oWOHT PGrv7Kk69yIU9AFDf216O6PvWtPaAIp+5AXg45NHLeG5xRB02nFXi+7cQ0BeSpyWNZ8E Q91mTzy/Md1aHC6UQi9owty7oWtsvyI+WPCB3OFYKkCCSv6ilKe/uu403t12qO07MsMk nG5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=nWnIamaDDd5sKkBLVne0MK9UBvGOo+jJRiFIvt4dU0s=; b=SsRVgma0fQMsBrDIAaM6QUbVzU1rHMCijbhj7LTkQikUy1NPFBpn5caJqf884aQlDL hfHwyMFYQj35PqER6E0UbdYobTH/agojWbDtElIm3DZGfFjP2WsJjLeTTp11khBKIjoK EB6cT7bApIONFwUy1muIb94foL9WlxC6QOcxMzl5Ufr/akKTVqr0cDyLI2rxfUmcc1Gi oQlSgy/9XCGfVkFK/o4+P0t1blmt14VR/GM3mY0PSWPF8XDsxkyL2ZvWjbEyE5qKOp/q YlWlgW/zCsrHyixc1r+s4l+6wVDXNF7mOIrAb0Wl4eEBA1NcjLT9mih63tjlL2digTrz B0DQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si2040243pgc.532.2018.04.03.07.17.43; Tue, 03 Apr 2018 07:18:00 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259AbeDCOQ2 (ORCPT + 99 others); Tue, 3 Apr 2018 10:16:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50854 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750793AbeDCOQ1 (ORCPT ); Tue, 3 Apr 2018 10:16:27 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w33EBe6u044480 for ; Tue, 3 Apr 2018 10:16:26 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h4avuhkdx-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 03 Apr 2018 10:16:26 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Apr 2018 10:16:25 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Apr 2018 10:16:21 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w33EGJhB46596332; Tue, 3 Apr 2018 14:16:21 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A1D4B2050; Tue, 3 Apr 2018 11:18:29 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id E091EB2065; Tue, 3 Apr 2018 11:18:28 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 406A516C86A1; Tue, 3 Apr 2018 07:17:18 -0700 (PDT) Date: Tue, 3 Apr 2018 07:17:18 -0700 From: "Paul E. McKenney" To: David Howells Cc: Andrea Parri , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, Andrea Parri , Alan Stern , Will Deacon , Boqun Feng , Nicholas Piggin , Jade Alglave , Luc Maranget , Akira Yokosawa Subject: Re: [PATCH v2 1/3] locking: Document the semantics of spin_is_locked() Reply-To: paulmck@linux.vnet.ibm.com References: <20180403133543.GA26653@andrea> <1522600912-6208-2-git-send-email-andrea.parri@amarulasolutions.com> <1522600912-6208-1-git-send-email-andrea.parri@amarulasolutions.com> <29562.1522759749@warthog.procyon.org.uk> <13191.1522763553@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13191.1522763553@warthog.procyon.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18040314-0036-0000-0000-000002DB2208 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008795; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01012533; UDB=6.00516045; IPR=6.00791799; MB=3.00020391; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-03 14:16:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040314-0037-0000-0000-000043DA4363 Message-Id: <20180403141718.GG3948@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-04-03_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804030148 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2018 at 02:52:33PM +0100, David Howells wrote: > Andrea Parri wrote: > > > > It's more complicated than that. This function is dangerous and should be > > > used with extreme care. In the case where CONFIG_SMP=n the value is locked > > > one way or the other and it might be the wrong way. > > > > You mean "unlocked"? (aka, return 0) > > No, I mean "fixed", sorry. We've had problems stemming from this before on UP > systems. Oooh... I had forgotten about spinlocks disappearing on UP systems, good catch! Suggestions for a fix? Clearly great care is required when using it in things like WARN_ON()... Thanx, Paul