From patchwork Wed May 30 00:04:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10437401 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 605BE601E9 for ; Wed, 30 May 2018 00:05:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50BF127FB0 for ; Wed, 30 May 2018 00:05:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 451EE287C8; Wed, 30 May 2018 00:05:22 +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 35A1227FB0 for ; Wed, 30 May 2018 00:05:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967566AbeE3AFT (ORCPT ); Tue, 29 May 2018 20:05:19 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:40153 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755154AbeE3AFP (ORCPT ); Tue, 29 May 2018 20:05:15 -0400 Received: by mail-pf0-f195.google.com with SMTP id f189-v6so8060997pfa.7 for ; Tue, 29 May 2018 17:05:15 -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=nhJUBisWNkiIeN2N7gA35XwDqBtbPGZ+nZsYdXT8s9w=; b=n4HDsPyY7SS+wI0NDsceagciIcop0uovQJy5OaZM/kwGj0iaVU9eNdgQcjfS76BtpO 32VT+C8poAMQo5Gv3rnC+xgQa5woAr6Tx3CURJFd28sCNuedXTJXOfi5U3VfG94cjamU P1JTScE52y1vaCnMlDXUym/nXLqwwpm16aIOrvAqkClBZ+W1YTJY8q4Ixur+xQkN6NOG KDUZtPeMI02YgrJ9dnICWWrHjbV5Y6ANyqzVgOZJt6k8IDwmocK8mugBwh7JmHzKrlgh gdH0EMPASOfRnlHoiTWJ9sqmHc1U+eDw8sMhCTHKXTQ+n8VBU+5+ThTSL1nf8CJJqZpt 1pWw== 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=nhJUBisWNkiIeN2N7gA35XwDqBtbPGZ+nZsYdXT8s9w=; b=J10dQOXZQrm7nH2/5Yo+f/zUaW1r+em8stOkmJxaSQLa5nCOnoOuHLYt3JtBz5QWYY CwsuqSF5Gqg9Bgx36BrGw0ls1swLJZrvDA/+Cfzh0sZ+s2T0T3TOPpo+5zQfnNTrhqfk dIU0cqQxKkbejyPHmhpN9EyYnvv7t0fWM5dYDO3sI9U+QT5VLIcpHVmW9t6Eo9asF0Uk jssA6PMs/WQHs8A4vpc6HkLMUMoxTu5OMt1j46x1RxHZNSe2uB0uiXOF9T04E1QeZ2uP MwyTuXpKa5AxOHgAQ3G0STJKl2nMv93PEIwzWGkbD5/meD7yO4mIDiaGdEfLVShQP8C8 Jmmg== X-Gm-Message-State: ALKqPwf/Hl2+WuJnFRck3TIA9CZlprSRhp4bBiFNsiJjNDdclDDBTqqq Syp7V+ijzgwI1uRabvNoi46mqw== X-Google-Smtp-Source: ADUXVKLCGg1DYaAAG7a5kZabThomFHGgnTha96lm+PB+M85xx4h6Jj0Jn+8MGKCX5EP5w6t67wdFFQ== X-Received: by 2002:a62:3e11:: with SMTP id l17-v6mr517556pfa.18.1527638714727; Tue, 29 May 2018 17:05:14 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id w12-v6sm86979211pfi.158.2018.05.29.17.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 17:05:14 -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 v8 3/8] srcu: Add notrace variant of srcu_dereference Date: Tue, 29 May 2018 17:04:55 -0700 Message-Id: <20180530000500.257225-4-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog In-Reply-To: <20180530000500.257225-1-joel@joelfernandes.org> References: <20180530000500.257225-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.