[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d82068a0-8bb0-b824-49f4-c7f55525ac95@linux.alibaba.com>
Date: Fri, 24 Sep 2021 11:36:53 +0800
From: 王贇 <yun.wang@...ux.alibaba.com>
To: Steven Rostedt <rostedt@...dmis.org>
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 2021/9/24 上午11:26, Steven Rostedt wrote:
> 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.
Thanks for the explain :-)
Context available for scheduling should not in these situations, will
move down the 'disable' in v2.
Regards,
Michael Wang
>
> -- Steve
>
Powered by blists - more mailing lists