From patchwork Thu Jun 21 22:32:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10480813 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 4D81960532 for ; Thu, 21 Jun 2018 22:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AEB528E2B for ; Thu, 21 Jun 2018 22:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FC5F28F2F; Thu, 21 Jun 2018 22:34:44 +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 D4A3428E2B for ; Thu, 21 Jun 2018 22:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933876AbeFUWda (ORCPT ); Thu, 21 Jun 2018 18:33:30 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:43851 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933734AbeFUWd2 (ORCPT ); Thu, 21 Jun 2018 18:33:28 -0400 Received: by mail-pg0-f65.google.com with SMTP id a14-v6so2041626pgw.10 for ; Thu, 21 Jun 2018 15:33:27 -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=ro5tTEs/HRkysJu69zMDIb2AbN1vX9VkrXO1QdKWDKdggBbkfEcFWzM60dNj83LsNG oZain8dPBiVa92t4cALvbCH3Rt7HCkX1CVR9tigtOvZmDM6JL+e6aFG87BNKXkXIgrWx Aujf6t9AgEG2WdCVGMTbP3q8Fb7Qx8ILsdmb0= 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=eT5T5Ohfc6dNa9/GOnwn1asrTixEZ9u1MimjLOZyVK2fDghrPfr4XnqnzVQGQkYDVv KnjdcFIQ1YJH4lQnBIGIf592ZX2HpgPTBwrr7l1j4rd2m6srQ7RBOlJlW4WK9QpdDHVW /VeSZBDqAVv0irZZ9/AwCJHNvOrSYEOU92OYWBaYKEg5kc+2IMMHNVUCm8M4DZQwk2He VLRjlBPdpsISEVVKEoy9w2zTfhdcqsQvGoxgSNbw52xNdl+PiY8o2nrHA0CMBb8psZeH 3bKSJFqWmVOtf6Ibghv8PowSs408NmTNgq6NDFcWft1qj2c/Im6HoIpBrATW1rUWj8f+ dFTA== X-Gm-Message-State: APt69E3f6bY0Vivlp+bURP6gPiq7B+2ow0cMxffAz0vQVyfoPcPuB0YU 4FRxA6TKzXjzt9OPdeICJwpBUw== X-Google-Smtp-Source: ADUXVKINawIAkOMUND7ttKW67qBSkWDDKycByql+PWAeWu8rKJF+KJGIIhAESZ6REhEoCBRsswz9mg== X-Received: by 2002:a62:6b06:: with SMTP id g6-v6mr28893438pfc.96.1529620407637; Thu, 21 Jun 2018 15:33:27 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id x19-v6sm11060824pfi.5.2018.06.21.15.33.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 15:33:27 -0700 (PDT) From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, "Joel Fernandes (Google)" , Boqun Feng , Byungchul Park , Erick Reyes , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Paul McKenney , Peter Zijlstra , Shuah Khan , Steven Rostedt , Thomas Glexiner , Todd Kjos , Tom Zanussi , Will Deacon Subject: [PATCH v9 2/7] srcu: Add notrace variant of srcu_dereference Date: Thu, 21 Jun 2018 15:32:31 -0700 Message-Id: <20180621223236.211495-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog In-Reply-To: <20180621223236.211495-1-joel@joelfernandes.org> References: <20180621223236.211495-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.