Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030854AbbD1QpG (ORCPT ); Tue, 28 Apr 2015 12:45:06 -0400 Received: from mail-am1on0088.outbound.protection.outlook.com ([157.56.112.88]:64431 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030593AbbD1QpC (ORCPT ); Tue, 28 Apr 2015 12:45:02 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; redhat.com; dkim=none (message not signed) header.d=none; From: Chris Metcalf To: Peter Zijlstra CC: Chris Metcalf , "Paul E. McKenney" , Manfred Spraul , "Oleg Nesterov" , Kirill Tkhai , , Ingo Molnar , "Josh Poimboeuf" Subject: [PATCH] spinlock: clarify doc for raw_spin_unlock_wait() Date: Tue, 28 Apr 2015 12:44:45 -0400 Message-ID: <1430239485-17700-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <20150428162458.GI5029@twins.programming.kicks-ass.net> References: <20150428162458.GI5029@twins.programming.kicks-ass.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(377454003)(479174004)(189002)(199003)(24454002)(48376002)(42186005)(50466002)(36756003)(104016003)(62966003)(229853001)(77156002)(105606002)(86362001)(76176999)(33646002)(47776003)(110136001)(50226001)(19580395003)(106466001)(46102003)(6806004)(92566002)(85426001)(87936001)(19580405001)(2950100001)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR02MB0781;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0781; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006)(3002001);SRVR:VI1PR02MB0781;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0781; X-Forefront-PRVS: 0560A2214D X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2015 16:44:58.9271 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB0781 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1747 Lines: 45 The intent of the function is to wait for the current locker. Thus, we don't have to worry about potential later lockers, but we also have to ensure that the arch implementation doesn't return a false positive for the current locker. Signed-off-by: Chris Metcalf --- On 04/28/2015 12:24 PM, Peter Zijlstra wrote: > I think it must not return before the lock holder that is current at the > time of calling releases. Anything thereafter is indeed fair game as per > your logic above. Great, that seems like a workable definition. How does this modified language seem? With this definition I can actually modify the implementation of tile's arch_raw_spin_unlock_wait() to just read current_ticket once and just wait until it changes (assuming the lock is, in fact, locked). Not sure whose tree this should go through; any takers? include/linux/spinlock.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 3e18379dfa6f..36de5fc86647 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -141,7 +141,8 @@ do { \ #endif /** - * raw_spin_unlock_wait - wait until the spinlock gets unlocked + * raw_spin_unlock_wait - wait until the lock holder that is current at the + * time of calling releases the lock (or return immediately if unlocked). * @lock: the spinlock in question. */ #define raw_spin_unlock_wait(lock) arch_spin_unlock_wait(&(lock)->raw_lock) -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/