Received: by 10.213.65.68 with SMTP id h4csp3481164imn; Tue, 3 Apr 2018 05:50:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+HI0xDx3DOv3HEQBtWXiaolcbTzjFthYXjsJEfiXUYWNf8XKcjnAfnAwklMHFtaE98Smx1 X-Received: by 10.99.111.136 with SMTP id k130mr8884002pgc.378.1522759837846; Tue, 03 Apr 2018 05:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522759837; cv=none; d=google.com; s=arc-20160816; b=w97FYniRxewuHw4fdg2HgyAQJQYneMqLWuTjFRqTytuw71udRM0wOYlByCHJsQQXek A3keEZQiZne0xvEVgV9wiDHZvQfO+qsyWIU2SRlVmetGq/8siwAyycXxwni8D7RKEr2E xAiqW0krJf7lMhYLH+P/QX5FUaW1NZ/q7HXjZRsynP+MW/nrKQDA15eMOUykNCLHWfB7 bB9drv23mAB6BbKnF4JEUyXukAaIJrA5GMefZREHW/2HOQn7FIlV+5wCCrJVSwvkWt8P 23itJlcCKawXNvf0BmsZiLrgafExWbUgQrO98NW/SJ2RqCZYAF8CGNeHIT9nngpcsNBb 0iLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization :arc-authentication-results; bh=HlxmiP3ewP+Nk37QAEySvFOcrRlFgVTMTyNycZTSvJc=; b=kBx1sM2zFtdp+hoxCp1KjaqM9BcWEVWT+zHF3fmtdnwo2p1mZJ82vdps2kl2kIcFNk BZ1AXobUTF4mUTxzNnOIDFV2/vBF9VSF90YnmmrD9K1azcZun5EJSG4pH6RcKn2zRRdE IrzTH44sB6w1I+GMpiNZ+7C2jXQs6uvQLs5Jw57Uaf5cj4+k9Gb1BVvknkkbSiu3BzjF R1gsVevGGTyanxBrUi5hc072TsQpvYvqv7rJrbpYOTO9qOS5ssfNbBbf4ONo1hWMz8bc tqA+VI0eRlxDUaVaxf7wXd7rouMrqhMo5zNisa/r3HPtfTNomgxKtnSpPVifcmQ1oEsA 9gfQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si2106826pfa.66.2018.04.03.05.50.23; Tue, 03 Apr 2018 05:50:37 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932149AbeDCMtO (ORCPT + 99 others); Tue, 3 Apr 2018 08:49:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49666 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932087AbeDCMtN (ORCPT ); Tue, 3 Apr 2018 08:49:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D10D08185352; Tue, 3 Apr 2018 12:49:12 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-59.rdu2.redhat.com [10.10.120.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93A1010EE850; Tue, 3 Apr 2018 12:49:09 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <1522600912-6208-2-git-send-email-andrea.parri@amarulasolutions.com> References: <1522600912-6208-2-git-send-email-andrea.parri@amarulasolutions.com> <1522600912-6208-1-git-send-email-andrea.parri@amarulasolutions.com> To: Andrea Parri Cc: dhowells@redhat.com, paulmck@linux.vnet.ibm.com, 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() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29561.1522759749.1@warthog.procyon.org.uk> Date: Tue, 03 Apr 2018 13:49:09 +0100 Message-ID: <29562.1522759749@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 12:49:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 12:49:12 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrea Parri wrote: > +/** > + * spin_is_locked() - Check whether a spinlock is locked. > + * @lock: Pointer to the spinlock. > + * > + * This function is NOT required to provide any memory ordering > + * guarantees; it could be used for debugging purposes or, when > + * additional synchronization is needed, accompanied with other > + * constructs (memory barriers) enforcing the synchronization. > + * > + * Return: 1, if @lock is (found to be) locked; 0, otherwise. 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. David