public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Donnefort <vincent.donnefort@arm.com>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
	valentin.schneider@arm.com
Subject: Re: [PATCH 3/4] cpu/hotplug: Add cpuhp_invoke_callback_range()
Date: Thu, 21 Jan 2021 12:18:33 +0100	[thread overview]
Message-ID: <YAljCQZf+ZqB3S4K@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210121105756.GA312559@e120877-lin.cambridge.arm.com>

On Thu, Jan 21, 2021 at 10:57:57AM +0000, Vincent Donnefort wrote:
> On Wed, Jan 20, 2021 at 06:53:33PM +0100, Peter Zijlstra wrote:
> > On Wed, Jan 20, 2021 at 06:45:16PM +0100, Peter Zijlstra wrote:
> > > On Mon, Jan 11, 2021 at 05:10:46PM +0000, vincent.donnefort@arm.com wrote:
> > > > @@ -475,6 +478,11 @@ cpuhp_set_state(struct cpuhp_cpu_state *st, enum cpuhp_state target)
> > > >  static inline void
> > > >  cpuhp_reset_state(struct cpuhp_cpu_state *st, enum cpuhp_state prev_state)
> > > >  {
> > > > +	st->target = prev_state;
> > > > +
> > > > +	if (st->rollback)
> > > > +		return;
> > > 
> > > I'm thinking that if we call rollback while already rollback we're hosed
> > > something fierce, no?
> > > 
> > > That like going up, failing, going back down again, also failing, giving
> > > up in a fiery death.
> > 
> > Ooh, is this a hack for _cpu_down():
> > 
> > 	ret = cpuhp_down_callbacks(cpu, st, target);
> > 	if (ret && st->state == CPUHP_TEARDOWN_CPU && st->state < prev_state) {
> > 		cpuhp_reset_state(st, prev_state);
> > 		__cpuhp_kick_ap(st);
> > 	}
> > 
> > Where cpuhp_down_callbacks() can already have called cpuhp_reset_state() ?
> 
> Yes, it is now possible that this function will be called twice during the
> rollback. Shall I avoid this and treat the case above differently ? i.e. "if we
> are here, state has already been reset, and we should only set st->target".

Not sure, but a comment would be useful :-)

  reply	other threads:[~2021-01-21 11:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 17:10 [PATCH 0/4] cpu/hotplug: rollback and "fail" interface fixes vincent.donnefort
2021-01-11 17:10 ` [PATCH 1/4] cpu/hotplug: Allowing to reset fail injection vincent.donnefort
2021-01-11 17:10 ` [PATCH 2/4] cpu/hotplug: CPUHP_BRINGUP_CPU exception in " vincent.donnefort
2021-01-20 12:58   ` Peter Zijlstra
2021-01-20 15:17     ` Vincent Donnefort
2021-01-20 17:30       ` Peter Zijlstra
2021-01-11 17:10 ` [PATCH 3/4] cpu/hotplug: Add cpuhp_invoke_callback_range() vincent.donnefort
2021-01-20 13:11   ` Peter Zijlstra
2021-01-20 17:54     ` Peter Zijlstra
2021-01-20 17:45   ` Peter Zijlstra
2021-01-20 17:53     ` Peter Zijlstra
2021-01-21 10:57       ` Vincent Donnefort
2021-01-21 11:18         ` Peter Zijlstra [this message]
2021-01-20 17:49   ` Peter Zijlstra
2021-01-11 17:10 ` [PATCH 4/4] cpu/hotplug: Fix CPU down rollback vincent.donnefort
2021-01-21 14:57   ` Peter Zijlstra
2021-01-21 15:43     ` Vincent Donnefort

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=YAljCQZf+ZqB3S4K@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.donnefort@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox