From patchwork Wed Sep 16 18:45:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 260774 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92178C433E2 for ; Wed, 16 Sep 2020 18:46:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4247320809 for ; Wed, 16 Sep 2020 18:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600281995; bh=jPXAjpQCZ862tVOBiMIHndV4XBLyC44PoH4AOVqApsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=b6B58DgnpCc9CDMK35GQjNjey5eCVWa9AM6XDeGr3gmEKg5t1bzDwH/k7ZGqIF1mf gtFnNhCI7pdNXxYVvRL6kD/oQOXN6/AEgRgBP+HHFRvhpHU5asenDg68mDBq3E9E5G wPrRodlRkKuUoQ2c2+ISY2j8NCK15Dg+xTkDwd4U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728240AbgIPSqV (ORCPT ); Wed, 16 Sep 2020 14:46:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:44342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728154AbgIPSqO (ORCPT ); Wed, 16 Sep 2020 14:46:14 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A478221EF; Wed, 16 Sep 2020 18:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600281969; bh=jPXAjpQCZ862tVOBiMIHndV4XBLyC44PoH4AOVqApsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cfYutagyCDKhwiv/fmpQgLz/EQNVGj5JbRF/wF2xF/EkczxIDcDUYXgyqJIRRXKHJ Xf9riCS2eLkWCfBZNsAfbBojDPloJuaqOW/vCrM8XMeThsOoIsTJI8hUNzx5O6JCLy DNzji6bBqiaB1iOWKtCZ0q0fkUAhiOu2vW8KE8dg= From: Jakub Kicinski To: davem@davemloft.net, paulmck@kernel.org, joel@joelfernandes.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org, josh@joshtriplett.org, peterz@infradead.org, christian.brauner@ubuntu.com, Jakub Kicinski , jiangshanlai@gmail.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com Subject: [PATCH net-next 5/7] srcu: use a more appropriate lockdep helper Date: Wed, 16 Sep 2020 11:45:26 -0700 Message-Id: <20200916184528.498184-6-kuba@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200916184528.498184-1-kuba@kernel.org> References: <20200916184528.498184-1-kuba@kernel.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org lockdep_is_held() is defined as: #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map) it hides away the dereference, so that builds with !LOCKDEP don't break. We should use it instead of using lock_is_held() directly. This didn't use to be a problem, because RCU_LOCKDEP_WARN() cuts the condition out with the preprocessor if !LOCKDEP. This will soon change. Signed-off-by: Jakub Kicinski --- CC: jiangshanlai@gmail.com CC: paulmck@kernel.org CC: josh@joshtriplett.org CC: rostedt@goodmis.org CC: mathieu.desnoyers@efficios.com --- kernel/rcu/srcutree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index c100acf332ed..8123ef15a159 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -919,7 +919,7 @@ static void __synchronize_srcu(struct srcu_struct *ssp, bool do_norm) { struct rcu_synchronize rcu; - RCU_LOCKDEP_WARN(lock_is_held(&ssp->dep_map) || + RCU_LOCKDEP_WARN(lockdep_is_held(ssp) || lock_is_held(&rcu_bh_lock_map) || lock_is_held(&rcu_lock_map) || lock_is_held(&rcu_sched_lock_map),