[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251103141011.GC3245006@noisy.programming.kicks-ass.net>
Date: Mon, 3 Nov 2025 15:10:11 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] cpu: Make atomic callbacks run on UP with disabled
interrupts
On Mon, Nov 03, 2025 at 02:10:51PM +0100, Sebastian Andrzej Siewior wrote:
> On 2025-11-03 13:42:54 [+0100], Peter Zijlstra wrote:
> > How about:
> >
> > if (cpuhp_is_atomic_state(state)) {
> > guard(irqsave)();
> > ret = cpuhp_invoke_callback(cpu, state, bringup, node, NULL);
> > /*
> > * STARTING/DYING must not fail!
> > */
> > WARN_ON_ONCE(ret);
> > } else {
> > ret = cpuhp_invoke_callback(cpu, state, bringup, node, NULL);
> > }
> >
> > which is a little more like cpuhp_thread_fun()
>
> very nice indeed. What about WARN_ON_ONCE(ret && bringup) given the
> BUG_ON(ret && !bringup) below?
That would be confusing to read, the condition here is any failure. And
yes, this way you'll get a WARN and then a BUG, but meh :-)
Powered by blists - more mailing lists