linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing: Do not synchronize freeing of trigger filter on boot up
Date: Thu, 15 Dec 2022 15:10:27 -0800	[thread overview]
Message-ID: <20221215231027.GS4001@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <20221215173913.5432bfbf@gandalf.local.home>

On Thu, Dec 15, 2022 at 05:39:13PM -0500, Steven Rostedt wrote:
> On Thu, 15 Dec 2022 11:01:58 -0800
> "Paul E. McKenney" <paulmck@kernel.org> wrote:
> 
> > What case?
> > 
> > Here is one:
> > 
> > o	The newly spawned init process does something that uses RCU,
> > 	but is preempted while holding rcu_read_lock().
> > 
> > o	The boot thread, which did the preempting, waits for a grace
> > 	period.  If we use rcu_scheduler_active, all is well because
> > 	synchronize_rcu() will do a real run-time grace period, thus
> > 	waiting for that reader.
> > 
> > 	But system_state has not yet been updated, so if synchronize_rcu()
> > 	were instead to pay attention to that one, there might be a
> > 	tragically too-short RCU grace period.
> 
> The thing is, preemption is disabled the entire time here.
> 
> That is, from:
> 
> void kthread_show_list(void);
> noinline void __ref rest_init(void)
> {
> 	struct task_struct *tsk;
> 	int pid;
> 
> 	rcu_scheduler_starting();
> 
> through:
> 
> 	system_state = SYSTEM_SCHEDULING;
> 
> 	complete(&kthreadd_done);
> 
> 
> Preemption is disabled and other CPUs have not even been started yet.
> 
> Although the might_sleep() call might schedule the kernel_init() task but
> that will only block on the completion.
> 
> In other words, I don't think anything can cause any issues this early in
> the boot up.

The nice thing about the current placement of rcu_scheduler_starting()
is that there is not yet any other task to switch to.  ;-)

							Thanx, Paul

  reply	other threads:[~2022-12-15 23:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 22:24 [PATCH] tracing: Do not synchronize freeing of trigger filter on boot up Steven Rostedt
2022-12-13 23:49 ` Masami Hiramatsu
2022-12-14  0:03   ` Steven Rostedt
2022-12-14  7:31     ` Masami Hiramatsu
2022-12-14 20:03   ` Paul E. McKenney
2022-12-14 20:37     ` Mathieu Desnoyers
2022-12-14 21:26       ` Paul E. McKenney
2022-12-15 15:02     ` Steven Rostedt
2022-12-15 17:02       ` Paul E. McKenney
2022-12-15 17:25         ` Paul E. McKenney
2022-12-15 18:51         ` Steven Rostedt
2022-12-15 19:01           ` Paul E. McKenney
2022-12-15 22:39             ` Steven Rostedt
2022-12-15 23:10               ` Paul E. McKenney [this message]
2022-12-15 23:42                 ` Steven Rostedt
2022-12-16  1:01                   ` Paul E. McKenney
2022-12-16  4:40                     ` Paul E. McKenney
2022-12-16 11:08                       ` Steven Rostedt
2022-12-18  0:29                         ` Paul E. McKenney

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=20221215231027.GS4001@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).