From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968135AbeE3AF0 (ORCPT ); Tue, 29 May 2018 20:05:26 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43800 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755375AbeE3AFP (ORCPT ); Tue, 29 May 2018 20:05:15 -0400 X-Google-Smtp-Source: ADUXVKLCGg1DYaAAG7a5kZabThomFHGgnTha96lm+PB+M85xx4h6Jj0Jn+8MGKCX5EP5w6t67wdFFQ== 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- 2.17.0.921.gf22659ad46-goog From mboxrd@z Thu Jan 1 00:00:00 1970 From: joelaf at google.com (Joel Fernandes) Date: Tue, 29 May 2018 17:04:55 -0700 Subject: [PATCH v8 3/8] srcu: Add notrace variant of srcu_dereference In-Reply-To: <20180530000500.257225-1-joel@joelfernandes.org> References: <20180530000500.257225-1-joel@joelfernandes.org> Message-ID: <20180530000500.257225-4-joel@joelfernandes.org> 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. -- 2.17.0.921.gf22659ad46-goog -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: joelaf@google.com (Joel Fernandes) Date: Tue, 29 May 2018 17:04:55 -0700 Subject: [PATCH v8 3/8] srcu: Add notrace variant of srcu_dereference In-Reply-To: <20180530000500.257225-1-joel@joelfernandes.org> References: <20180530000500.257225-1-joel@joelfernandes.org> Message-ID: <20180530000500.257225-4-joel@joelfernandes.org> Content-Type: text/plain; charset="UTF-8" Message-ID: <20180530000455.zmr1D68v5qSxGd6_W3A98xMT8GF0NOIpTVvUgyorWpI@z> 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. -- 2.17.0.921.gf22659ad46-goog -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html