Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4723752imm; Tue, 9 Oct 2018 04:23:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV62i2DnRfomWj049Z1g4Qm6iwcX3qqoZPtdB/BjUyW02LnbR25xU1Cp70m2fsVk8bgmLZUtW X-Received: by 2002:a63:fe13:: with SMTP id p19-v6mr25094671pgh.265.1539084206028; Tue, 09 Oct 2018 04:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539084206; cv=none; d=google.com; s=arc-20160816; b=oSwxlRRrAKo4GsHxIcIf8+rbICquy6sULGNXhqKM+ecb3gGZE0XN4gBbFrxD9DHBnN u55Pw42q5bfSP5sh/KpHG1EnReC6KaDyE6MGhXNq22te1q03ZwS3sTQ0cw1EDXVAEfwU akuFJ6CTTs7jrqoYsgZD40tADSfc/4rYed7rbfqgYM2Eio0cj3To+zpWqFHZdLNUSJHE 3D35WZbdAkT5JNammGOFA9hvcQ1V7VdWunp8JTeKTZ38WJZr5UyTalKYyr0keV3WWhVJ J+32T5utMUcgjPtwVVPox+D/XFDpPITnwV2LtU3DvaFBGDDVihPkXMoVe/n1Gc43/tb7 7IWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=bTN2nC5WQ77J+z4yFlin6A99ePGMWDQnglew0OnVef0=; b=Hn/tqVvy1jNKlhpePR34OOGfZ4ZxXqK4jst7v5g6R+lvwHAOszZQJtXMofnP3h9PLl HF8lSacJ14k6jtLJi05lerjL4gfiiqVVYopQqJE6ULlt5IH8/fS5/qVwi3hqykpAI656 byKJLeRFUq+GWpAqD8wLIEx4dy1X3ZIulVSh4I5jOvC7wImKB9UWk03GKgG/LkLcvDPY ghvpeBIQ57e+y2FVR8rlQHKlcwXNzGCxjrTAQUapQypXK5ABHb9CMpn80nzDIhBJvwoG EMTTZEHtc9rdnx9cIPCPW6wRz4LAoVBg0q6t9tfasvPUYGLmwz7n7jWdWo1Wh4a0Zt8I hzSg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5-v6si19405043pgk.86.2018.10.09.04.23.11; Tue, 09 Oct 2018 04:23:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727672AbeJISim (ORCPT + 99 others); Tue, 9 Oct 2018 14:38:42 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37733 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbeJISim (ORCPT ); Tue, 9 Oct 2018 14:38:42 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w99BLnjg1014300 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 9 Oct 2018 04:21:49 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w99BLmIV1014297; Tue, 9 Oct 2018 04:21:48 -0700 Date: Tue, 9 Oct 2018 04:21:48 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Lance Roy Message-ID: Cc: paulmck@linux.ibm.com, ldr709@gmail.com, dvhart@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org Reply-To: ldr709@gmail.com, dvhart@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org, paulmck@linux.ibm.com In-Reply-To: <20181003053902.6910-12-ldr709@gmail.com> References: <20181003053902.6910-12-ldr709@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] futex: Replace spin_is_locked() with lockdep Git-Commit-ID: 4de1a293a08bdf8ec1530e02163930ac86f80ea2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96,FREEMAIL_FORGED_REPLYTO, FREEMAIL_REPLYTO_END_DIGIT autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4de1a293a08bdf8ec1530e02163930ac86f80ea2 Gitweb: https://git.kernel.org/tip/4de1a293a08bdf8ec1530e02163930ac86f80ea2 Author: Lance Roy AuthorDate: Tue, 2 Oct 2018 22:38:57 -0700 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 13:19:28 +0200 futex: Replace spin_is_locked() with lockdep lockdep_assert_held() is better suited for checking locking requirements, since it won't get confused when the lock is held by some other task. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy Signed-off-by: Thomas Gleixner Cc: "Paul E. McKenney" Cc: Peter Zijlstra Cc: Darren Hart Link: https://lkml.kernel.org/r/20181003053902.6910-12-ldr709@gmail.com --- kernel/futex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index 11fc3bb456d6..3e2de8fc1891 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1365,9 +1365,9 @@ static void __unqueue_futex(struct futex_q *q) { struct futex_hash_bucket *hb; - if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr)) - || WARN_ON(plist_node_empty(&q->list))) + if (WARN_ON_SMP(!q->lock_ptr) || WARN_ON(plist_node_empty(&q->list))) return; + lockdep_assert_held(q->lock_ptr); hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock); plist_del(&q->list, &hb->chain);