From patchwork Thu Jun 7 20:38:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10453541 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 1849460467 for ; Thu, 7 Jun 2018 20:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09D8729970 for ; Thu, 7 Jun 2018 20:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2E8829A4A; Thu, 7 Jun 2018 20:40:21 +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_ADSP_CUSTOM_MED, 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 9AD9029970 for ; Thu, 7 Jun 2018 20:40:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932521AbeFGUiz (ORCPT ); Thu, 7 Jun 2018 16:38:55 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46549 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932296AbeFGUix (ORCPT ); Thu, 7 Jun 2018 16:38:53 -0400 Received: by mail-pl0-f66.google.com with SMTP id 30-v6so6842038pld.13 for ; Thu, 07 Jun 2018 13:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6iRhcuxv7LYs9+eTV7AewL3TxlzUcdpZCae2r7yiQpU=; b=Muzo4xVgkpEDMqlgP/+gaZ2Wx2mmaTc4hREd0JFwyP8hl+nvSlAwBNTKijooaZoEqr Ttp4c4AkbQcCAwFV/sCcvjnEY/NDJUHXKJZWWesGvZmk0x6gyuAhfytSCi1J5ntxUgBw imqfEDJu7i0wVM0M2uquWSFNUb3PrfpHaGau+wshZXN1HP4wWfngCsHyTBzpYaqIFxgs 2Xw+hbcdeq3WdylLIL8yMjRlRUiqGa76kuyJRktYsLkBgfSTvQ4Bnk2cDoImkIN2ubdV Meb/1ZKQdIIGKC3YZCjaP9QwdWpey6tG2/D01OUu7RojlxawDQE+mPwyT1wZ6dC1Pqnt Cxyg== 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=6iRhcuxv7LYs9+eTV7AewL3TxlzUcdpZCae2r7yiQpU=; b=fQOABE6mCCICE9dexEHpIJFxpVTdjdHwBLkwnZtB3Q8piufqSxVIJiiMgH/0iOlg/y 3iK/Xb9Z/XaBNix7y3LihIP7hxPDJxrYwCWIudo+hYIiaN1nXGQJdn0WR63GUbE6i2lZ +TMxRAKCXCqVflrCkKLG4gVXRVxtsLMQ985h1IzsaUV3LKQEFNT/G34xQMPBvhcXB4z6 /XfN9gMYD2zn3HlI1koeA5n0u4KaGzkBqN2A52APW5rWltwuanAImEGLpQIqZk7eFA7/ A8yGKBOHypHfHz30dFODQHNOY08pSs+BfXqweamuQQltL/F3dtFMVFAx4mERXf1wIA5X 01Jw== X-Gm-Message-State: APt69E06GkqEz+5SSn4BIZ739Xkt9WtcKG23YeIn6e0FXd9Zz3hf96V1 xPBl9mdP8Cz0/ce+win026tv0A== X-Google-Smtp-Source: ADUXVKIdru7e6eZf+yycv5YQ/k/CNUIUwSUq51+HNwLSeS8N7NhrWGcbBbQ8sG9cF97H/pKYe5TJJg== X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr3507704plb.274.1528403931995; Thu, 07 Jun 2018 13:38:51 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id v27-v6sm10324174pfi.23.2018.06.07.13.38.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 13:38:51 -0700 (PDT) From: Joel Fernandes X-Google-Original-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 Subject: [PATCH v9 2/7] srcu: Add notrace variant of srcu_dereference Date: Thu, 7 Jun 2018 13:38:10 -0700 Message-Id: <20180607203815.255845-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.1.1185.g55be947832-goog In-Reply-To: <20180607203815.255845-1-joel@joelfernandes.org> References: <20180607203815.255845-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 2ec618979b20..a1c4947be877 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -135,6 +135,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.