[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210923232619.50103473@oasis.local.home>
Date: Thu, 23 Sep 2021 23:26:19 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: 王贇 <yun.wang@...ux.alibaba.com>
Cc: Ingo Molnar <mingo@...hat.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] trace: prevent preemption in
perf_ftrace_function_call()
On Fri, 24 Sep 2021 10:08:10 +0800
王贇 <yun.wang@...ux.alibaba.com> wrote:
> I found the rcu tree implementation of rcu_is_watching() will check
> this_cpu_ptr(&rcu_data.dynticks), and after that enable the preemption.
>
> If preemption happened after that and before we disable here, there are
> still possibility that the CPU changed and make the dynticks checking
> invalid, isn't it?
If it can be scheduled, then RCU is definitely watching ;-)
The rcu_is_watching() is a safe guard for places that are in between
context switches. Not task context switches, but transitioning between
kernel and user space, or going into or out of idle, or transitioning
in and out of an interrupt. There are small critical sections that RCU
is not watching, and we are actually working on making those locations
disable instrumentation (like tracing), where rcu_is_watching() will no
longer be needed.
-- Steve
Powered by blists - more mailing lists