mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 王贇 <yun.wang@linux.alibaba.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>, open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] trace: prevent preemption in perf_ftrace_function_call()
Date: Fri, 24 Sep 2021 11:36:53 +0800	[thread overview]
Message-ID: <d82068a0-8bb0-b824-49f4-c7f55525ac95@linux.alibaba.com> (raw)
In-Reply-To: <20210923232619.50103473@oasis.local.home>



On 2021/9/24 上午11:26, Steven Rostedt wrote:
> On Fri, 24 Sep 2021 10:08:10 +0800
> 王贇 <yun.wang@linux.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
> 

  parent reply	other threads:[~2021-09-24  3:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  3:42 王贇
2021-09-23  8:57 ` 王贇
2021-09-23 13:33 ` Steven Rostedt
2021-09-24  2:08   ` 王贇
2021-09-24  3:26     ` Steven Rostedt
2021-09-24  3:27       ` Steven Rostedt
2021-09-24  3:36       ` 王贇 [this message]
2021-09-24  4:38 ` [PATCH v2] " 王贇

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d82068a0-8bb0-b824-49f4-c7f55525ac95@linux.alibaba.com \
    --to=yun.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®