From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751279AbeDCOQ2 (ORCPT ); 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 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 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