[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230314174948.17a01cd4@gandalf.local.home>
Date: Tue, 14 Mar 2023 17:49:48 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
stable@...r.kernel.org, Dave Hansen <dave.hansen@...ux.intel.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Joel Fernandes <joel@...lfernandes.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>
Subject: Re: [for-linus][PATCH 5/5] tracing: Make tracepoint lockdep check
actually test something
On Tue, 14 Mar 2023 14:08:28 -0700
"Paul E. McKenney" <paulmck@...nel.org> wrote:
> On Tue, Mar 14, 2023 at 03:02:41PM -0400, Steven Rostedt wrote:
> > From: "Steven Rostedt (Google)" <rostedt@...dmis.org>
> >
> > A while ago where the trace events had the following:
> >
> > rcu_read_lock_sched_notrace();
> > rcu_dereference_sched(...);
> > rcu_read_unlock_sched_notrace();
> >
> > If the tracepoint is enabled, it could trigger RCU issues if called in
> > the wrong place. And this warning was only triggered if lockdep was
> > enabled. If the tracepoint was never enabled with lockdep, the bug would
> > not be caught. To handle this, the above sequence was done when lockdep
> > was enabled regardless if the tracepoint was enabled or not (although the
> > always enabled code really didn't do anything, it would still trigger a
> > warning).
> >
> > But a lot has changed since that lockdep code was added. One is, that
> > sequence no longer triggers any warning. Another is, the tracepoint when
> > enabled doesn't even do that sequence anymore.
> >
> > The main check we care about today is whether RCU is "watching" or not.
> > So if lockdep is enabled, always check if rcu_is_watching() which will
> > trigger a warning if it is not (tracepoints require RCU to be watching).
> >
> > Note, that old sequence did add a bit of overhead when lockdep was enabled,
> > and with the latest kernel updates, would cause the system to slow down
> > enough to trigger kernel "stalled" warnings.
> >
> > Link: http://lore.kernel.org/lkml/20140806181801.GA4605@redhat.com
> > Link: http://lore.kernel.org/lkml/20140807175204.C257CAC5@viggo.jf.intel.com
> > Link: https://lore.kernel.org/lkml/20230307184645.521db5c9@gandalf.local.home/
> > Link: https://lore.kernel.org/linux-trace-kernel/20230310172856.77406446@gandalf.local.home
> >
> > Cc: stable@...r.kernel.org
> > Cc: Masami Hiramatsu <mhiramat@...nel.org>
> > Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> > Cc: "Paul E. McKenney" <paulmck@...nel.org>
> > Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> > Cc: Joel Fernandes <joel@...lfernandes.org>
> > Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > Fixes: e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU")
> > Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>
>
> Acked-by: Paul E. McKenney <paulmck@...nel.org>
>
Thanks Paul!
-- Steve
Powered by blists - more mailing lists