From patchwork Thu May 24 01:21:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10422579 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 E64FE60545 for ; Thu, 24 May 2018 01:22:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF826292E9 for ; Thu, 24 May 2018 01:22:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3FBE292F3; Thu, 24 May 2018 01:22:42 +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 3272E292F2 for ; Thu, 24 May 2018 01:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935447AbeEXBWi (ORCPT ); Wed, 23 May 2018 21:22:38 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:44002 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935397AbeEXBWb (ORCPT ); Wed, 23 May 2018 21:22:31 -0400 Received: by mail-pg0-f65.google.com with SMTP id p8-v6so10176811pgq.10 for ; Wed, 23 May 2018 18:22:31 -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=YvRQPRvl+Q0KN33lvBXXkaVMnCg3Qxpj/qiDzM2exzI=; b=TpUp98OY3UE6EMcECgwkfXL/XlLG/75CXkrPErT+h43qOY/BqbjZR4F+himZwRgSVG tyB9J+0XsxPmkLbi0LSAaUUb5dk2IEg+cKbMpHnpWACYHsX2nzf/vS4McILhXvu7hhwr TOEbJANFfyqkwrL4jC8nHHm6cC8lHu7modX3UeuYEP1okGKYeAulLWO/oquzXkwEz7YJ NbKWW3UgsaBMM/1RyuwhKwph3gQzVo1cK9xlov+MxCKzGA2hiMy24MLR5kWrP1BR++6y uTc98yIb5Brba+CGUxOIlcX4IcsKHcwOLxklXRvyNkz2X0rD0++kHvrdpyWo35Wzy7iw ECwA== 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=YvRQPRvl+Q0KN33lvBXXkaVMnCg3Qxpj/qiDzM2exzI=; b=QijWGE1XWRX9fJRhe8NojNg3oEnR00+SlmgP8hl+fVA6bliJsN8pSLZCq3V/tHAM2i nH6tHxnWxQyu9BzfVqcVokDTrG20FTylsp/oaliElFj0gWGNa2JrNc8KS8h6GJMGHARa pgH0VWECBzy6sBOEhOFzP4hNh6Go2QZFSwm5qOTcVGlcXa5t0tO4FMY7kY0cxETsjdSM BHtvSn72GuapvfSQwAInH3knTmgcyc+iU8vtDlubRf2HTxNcEbRqlzwUcCdKdxwV++fS +gh+/cHXzg2Q7YNUj95/jnjU7cAQoRQZxrULbQvz0qecknL4OW0gW5OAuRGKUqcVYnBj dGEQ== X-Gm-Message-State: ALKqPwfIlmxxgcIKWvaysKXZn1Gn5lA6LlPh16wgCe+DuC2q4lZcfg3h d0omJ/TKEHGEh0YIS7V4w70irw== X-Google-Smtp-Source: AB8JxZpbMIe0TDdlLMp9zj33/Rg67eeLhPnxsGMhDCCaeuQUreI1PD4EViOA6bJuz4m+AmlR2EOUlQ== X-Received: by 2002:a63:b709:: with SMTP id t9-v6mr4090776pgf.269.1527124950944; Wed, 23 May 2018 18:22:30 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id g15-v6sm26070996pgv.58.2018.05.23.18.22.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 18:22:30 -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 v7 3/8] srcu: Add notrace variant of srcu_dereference Date: Wed, 23 May 2018 18:21:52 -0700 Message-Id: <20180524012157.181277-4-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180524012157.181277-1-joel@joelfernandes.org> References: <20180524012157.181277-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.