Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2166026imm; Tue, 2 Oct 2018 22:42:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV61/aEue0wjvk3JtwBvSn9Wr6WnuT6O/LrZuLysmTMQdzfXjdxR+AL99mqtjD1055o9tEwCl X-Received: by 2002:a63:4454:: with SMTP id t20-v6mr8621924pgk.102.1538545372381; Tue, 02 Oct 2018 22:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538545372; cv=none; d=google.com; s=arc-20160816; b=CjdCXyJ659B6KImCvxJDI3vQw20ix7LAia6Do8DblpQOri0WQ6ndps80ngLRfyYJhc UxXAaglF6w34yCiVubbZoO2ERebTRZ4U6PwBrLYmlloP2p9lFULfY/m6qtkhbssGaLdc ucPBxqrdpRgxnPYML72f5bq1HykZ0x/IBeCwQY7LbsFCpMgXlB3BUBY+XBVLKMmVdF/y FvuaSKNSjRRr0lHR8TIgmbVWILZ/fd6ohlZp1JNPppc9D2mImLiWZE0UGKLxYJV5yYdF 1pckCUdRMo/Oa6kZ0ri+rEcPIHWRXnM5W8+14zj6k8mWURYnDmQvYNZS+pOQo9JWgxh+ XQ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :reply-to:references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DBxsHysBh3lZnjuA3F/9N+mg9pNBgy3X6vmX2UgKVI8=; b=wIHMkOsXz9BZZ4s/w+b9RdI0jcBZimUi56loZtdlXOtNK5HnnfJPZN0WaTYMia2cnB bWKq5eDT+KHr6FEqWzvZacPLUzMdznvm7eu3DRzuH4oxQMXIPKcCfuFDScqk3+Trb9f7 uT5AFTG+GjhejictImZqS3dcLkUAHxwKs4aUHwuoBfmIY3WZ0PiNb1mfVFw5j/HUsOK6 t7F8sYiZB42Uf0aVYMYi/ERmJ6dD1iL8m6aCTDJziFBm/tnjFRl5U+tnC2Sfq6WYOLJ8 n8vFfCM6+r4wEO0cWngHbuFsHVO8Ch/xl2aZMdgOsHuYCXXdqa1HaYB1s8usDYxmWQLJ dlLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b3qMx+Zk; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f35-v6si407285plh.33.2018.10.02.22.42.37; Tue, 02 Oct 2018 22:42:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b3qMx+Zk; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727415AbeJCM1A (ORCPT + 99 others); Wed, 3 Oct 2018 08:27:00 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42903 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeJCM07 (ORCPT ); Wed, 3 Oct 2018 08:26:59 -0400 Received: by mail-pf1-f193.google.com with SMTP id f26-v6so952849pfn.9 for ; Tue, 02 Oct 2018 22:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=DBxsHysBh3lZnjuA3F/9N+mg9pNBgy3X6vmX2UgKVI8=; b=b3qMx+ZkNPi8XxYKvaxR28GxYMMab829EYJPMI7PkGGfUfXkez3Zj95rvJf3XGn0+g i/vI/nfkpUVkcdcs4+HUzCMMwxLd61Kl5K6qHobe77zEj1Y1aI///yjwcKImfo4GVfKV UaVnZbWafHfITmhq/7VqEOMQYI2EQtXCF73DHwOynF72TvJQ2LXr4nU+E3m2TtEfeFfX DaIm8ZLZBCvdyBS82NQemNKCXdDJ4dueMZUmFze3RisYWEsQKCGlTdZxC3sL5Wzdx2i2 EFxv5O4+6g0vbt62W0gvlnsypzSnSvoTEHgbVldpdHbXEvV25BuixH52nkg6RUlemU4+ LM7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=DBxsHysBh3lZnjuA3F/9N+mg9pNBgy3X6vmX2UgKVI8=; b=Vyv/Xa6o4/1yHZsEx4vsPRaphwzb2FZrYe27tcwrYekwgf8K9L7b+9oHRBfD1HNEY1 rZXmICA/Yym87Uvd28cYc4Jkxnyo8H5icpmtR+6FGo4gVFMeF2uvyqi+mPw04vT9vUls XYHfHdreiHp/In4IOX66UsvYKzrEqbItvBbG3wEsI3fdLBSj/VgEqAakoaYxPbsXVOjW relBQRw+QueibrjfL1eT+jnF7rtdAbYZ+KDHeLU1gw6Q3y41QaKD3AwcdEpi+lVKjKD2 +V1UNufuL+W+CTkR8Cvt/j0dlEEXKfR+WQHAoNlepabIqgEkf+KR4EMQ2/aM5fLUCzDv agow== X-Gm-Message-State: ABuFfoiivygrAWOZ+n9lDSYALbxX9uZQzqqNqSHP5JRrmixHSZS0l/7U mq7aHkNs7HjfxihICkiyBHfG/gs/eqI= X-Received: by 2002:a65:4548:: with SMTP id x8-v6mr17121484pgr.414.1538545209609; Tue, 02 Oct 2018 22:40:09 -0700 (PDT) Received: from E570.localdomain (c-24-21-68-121.hsd1.or.comcast.net. [24.21.68.121]) by smtp.gmail.com with ESMTPSA id t11-v6sm708248pgn.38.2018.10.02.22.40.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 22:40:09 -0700 (PDT) Received: by E570.localdomain (Postfix, from userid 1000) id 5E2361643D0; Tue, 2 Oct 2018 22:40:08 -0700 (PDT) From: Lance Roy To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Lance Roy , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart Subject: [PATCH 11/16] futex: Replace spin_is_locked() with lockdep Date: Tue, 2 Oct 2018 22:38:57 -0700 Message-Id: <20181003053902.6910-12-ldr709@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003053902.6910-1-ldr709@gmail.com> References: <20181003053902.6910-1-ldr709@gmail.com> Reply-To: Lance Roy MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org lockdep_assert_held() is better suited to checking locking requirements, since it won't get confused when someone else holds the lock. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Darren Hart --- 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); -- 2.19.0