From patchwork Thu Jun 28 18:21:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10494665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A25C9601BE for ; Thu, 28 Jun 2018 18:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A47022A026 for ; Thu, 28 Jun 2018 18:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 939C22A098; Thu, 28 Jun 2018 18:22:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 303312A026 for ; Thu, 28 Jun 2018 18:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030453AbeF1SWE (ORCPT ); Thu, 28 Jun 2018 14:22:04 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:32929 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030425AbeF1SV7 (ORCPT ); Thu, 28 Jun 2018 14:21:59 -0400 Received: by mail-pg0-f66.google.com with SMTP id e11-v6so2830779pgq.0 for ; Thu, 28 Jun 2018 11:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QKg90FTuSuW27iG9WkPEeAv4vw/9V5gf4/0TnS9jz5U=; b=L0n8QYnzMafn0UED6KfTLrCCidJg3O8fCiWdR0inqKPjetwFa8ngFimyR8hyMArhec Y54zJtlsi4uiIuFueDAln2/zyu9q29zisvPyx9umPHTggVreqMkfmYcc37I9Yna6gt+M 0KW24dn+jIgWTAKfvme8O6h8ViVyNyny4JVws= 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; bh=QKg90FTuSuW27iG9WkPEeAv4vw/9V5gf4/0TnS9jz5U=; b=oVpdoxstX+kqVnMpbxutUvAhMflDmTS4rcIdg38i8GIqJ6kilYF4ggCBrCZljRgTT4 YwJWOtDAWSdwxQ3iysqydxE3e0DAGCIOI6Dcj3Td9vuOlNMyAhVPedmk2kcU978QEuvy f3JAJDuHkUCrQex50b9jMXLrdGCCAtTT2JLB/1xwyYTlk4Niq02dejgyY+QQ9g1trhwH zrKifbgeQ5CFAQ5hjr/YtRGzHNwM2gSOiTxWDsVbVXml9mSFAY6Vn7zBy6Y91oeFRtlx bVCdEJF344jE0oi/gVeSbCFARHJIlY6VHaMJJIyZgT6hnxwOjUpa3v2lx9UP8IcKfPMV gNpg== X-Gm-Message-State: APt69E03JxSw9G+ZZTvVuodqeQxBnu3MF8Aa5I/NttJwzTA5hS+fq3eo 7+UpNXYVPBDL8woR/Vtcu2/uQg== X-Google-Smtp-Source: ADUXVKL+h2nPp6bZUHmT3HxDGWt+QQCi0M7p8fg5oCcg+GklkpCzOzSkohwU/p7NFh4grDLxHGMJbA== X-Received: by 2002:a63:aa03:: with SMTP id e3-v6mr9792456pgf.169.1530210118745; Thu, 28 Jun 2018 11:21:58 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id q10-v6sm13686027pfj.7.2018.06.28.11.21.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 11:21:58 -0700 (PDT) From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Boqun Feng , Byungchul Park , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Paul McKenney , Peter Zijlstra , Steven Rostedt , Thomas Glexiner , Tom Zanussi Subject: [PATCH v9 2/7] srcu: Add notrace variant of srcu_dereference Date: Thu, 28 Jun 2018 11:21:44 -0700 Message-Id: <20180628182149.226164-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog In-Reply-To: <20180628182149.226164-1-joel@joelfernandes.org> References: <20180628182149.226164-1-joel@joelfernandes.org> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Joel Fernandes (Google)" In the last patch in this series, we are making lockdep register hooks onto the irq_{disable,enable} tracepoints. These tracepoints use the _rcuidle tracepoint variant. In this series we switch the _rcuidle tracepoint callers to use SRCU instead of sched-RCU. Inorder to dereference the pointer to the probe functions, we could call srcu_dereference, however this API will call back into lockdep to check if the lock is held *before* the lockdep probe hooks have a chance to run and annotate the IRQ enabled/disabled state. For this reason we need a notrace variant of srcu_dereference since otherwise we get lockdep splats. This patch adds the needed srcu_dereference_notrace variant. Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/srcu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 3e72a291c401..67135d4a8a30 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -169,6 +169,11 @@ static inline int srcu_read_lock_held(const struct srcu_struct *sp) */ #define srcu_dereference(p, sp) srcu_dereference_check((p), (sp), 0) +/** + * srcu_dereference_notrace - no tracing and no lockdep calls from here + */ +#define srcu_dereference_notrace(p, sp) srcu_dereference_check((p), (sp), 1) + /** * srcu_read_lock - register a new reader for an SRCU-protected structure. * @sp: srcu_struct in which to register the new reader.