[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221215173913.5432bfbf@gandalf.local.home>
Date:   Thu, 15 Dec 2022 17:39:13 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     "Paul E. McKenney" <paulmck@...nel.org>
Cc:     Masami Hiramatsu <mhiramat@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux Trace Kernel <linux-trace-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH] tracing: Do not synchronize freeing of trigger filter
 on boot up
On Thu, 15 Dec 2022 11:01:58 -0800
"Paul E. McKenney" <paulmck@...nel.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.
-- Steve
Powered by blists - more mailing lists