From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>,
Josh Triplett <josh@joshtriplett.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Neeraj Upadhyay <neeraj.upadhyay@amd.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Uladzislau Rezki <urezki@gmail.com>, rcu <rcu@vger.kernel.org>,
Zqiang <qiang.zhang1211@gmail.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Sebastian Siewior <bigeasy@linutronix.de>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 4/4] Revert "kernel/sched: Modify initial boot task idle setup"
Date: Fri, 20 Oct 2023 15:48:36 +0200 [thread overview]
Message-ID: <20231020134836.GE33965@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <ZTJzEVkVfSMGumWU@lothringen>
On Fri, Oct 20, 2023 at 02:31:13PM +0200, Frederic Weisbecker wrote:
> Yeah I can't say I really like the old coverage of PF_IDLE either. The new one
> (after Liam's patch) is only halfway better defined though: it makes the boot
> CPU's idle behave quite well: PF_IDLE is set on idle entry. And secondary
> CPU's idle behave quite well also except when they go offline and then online
> again. And then the secondary boot code becomes PF_IDLE.
Bah offline, yeah, we should just not do that :-)
> We probably need something like this:
>
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 3b9d5c7eb4a2..b24d7937b989 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -1394,7 +1394,9 @@ void cpuhp_report_idle_dead(void)
> {
> struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
>
> + current->flags &= ~PF_IDLE;
> BUG_ON(st->state != CPUHP_AP_OFFLINE);
> +
> rcutree_report_cpu_dead();
> st->state = CPUHP_AP_IDLE_DEAD;
> /*
> @@ -1642,6 +1644,8 @@ void cpuhp_online_idle(enum cpuhp_state state)
> {
> struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
>
> + current->flags |= PF_IDLE;
> +
> /* Happens for the boot cpu */
> if (state != CPUHP_AP_ONLINE_IDLE)
> return;
Yeah that works I suppose.
next prev parent reply other threads:[~2023-10-20 13:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 23:35 [PATCH 0/4] rcu: Fix PF_IDLE related issues, part. 1 Frederic Weisbecker
2023-10-19 23:35 ` [PATCH 1/4] softirq: Rename __raise_softirq_irqoff() to raise_softirq_no_wake() Frederic Weisbecker
2023-10-19 23:35 ` [PATCH 2/4] softirq: Introduce raise_ksoftirqd_irqoff() Frederic Weisbecker
2023-10-19 23:35 ` [PATCH 3/4] rcu: Make tiny RCU use ksoftirqd to trigger a QS from idle Frederic Weisbecker
2023-10-20 0:49 ` Paul E. McKenney
2023-10-19 23:35 ` [PATCH 4/4] Revert "kernel/sched: Modify initial boot task idle setup" Frederic Weisbecker
2023-10-20 8:25 ` Peter Zijlstra
2023-10-20 12:31 ` Frederic Weisbecker
2023-10-20 13:48 ` Peter Zijlstra [this message]
2023-10-20 15:05 ` 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=20231020134836.GE33965@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Liam.Howlett@oracle.com \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@amd.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=urezki@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.