linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hsin-Yi Wang <hsinyi@chromium.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiri Kosina <jkosina@suse.cz>,
	Pavankumar Kondeti <pkondeti@codeaurora.org>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Zhenzhong Duan <zhenzhong.duan@oracle.com>,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <groeck@chromium.org>,
	Stephen Boyd <swboyd@chromium.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC v2] reboot: hotplug cpus in migrate_to_reboot_cpu()
Date: Fri, 10 Jan 2020 18:58:30 +0800	[thread overview]
Message-ID: <CAJMQK-ijrdcG-WKcNmgWu4ng5_TxrdYPr0TV0uAqS8UcFuL1ug@mail.gmail.com> (raw)
In-Reply-To: <87blrcbd3n.fsf@nanos.tec.linutronix.de>

On Fri, Jan 10, 2020 at 4:15 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Hsin-Yi Wang <hsinyi@chromium.org> writes:
>
> > @@ -220,8 +221,6 @@ void migrate_to_reboot_cpu(void)
> >       /* The boot cpu is always logical cpu 0 */
> >       int cpu = reboot_cpu;
> >
> > -     cpu_hotplug_disable();
> > -
> >       /* Make certain the cpu I'm about to reboot on is online */
> >       if (!cpu_online(cpu))
> >               cpu = cpumask_first(cpu_online_mask);
> > @@ -231,6 +230,11 @@ void migrate_to_reboot_cpu(void)
> >
> >       /* Make certain I only run on the appropriate processor */
> >       set_cpus_allowed_ptr(current, cpumask_of(cpu));
> > +
> > +     /* Hotplug other cpus if possible */
> > +#ifdef CONFIG_HOTPLUG_CPU
> > +     offline_secondary_cpus(cpu);
> > +#endif
>
> In general I like the idea, but shouldn't this remove the architecture
> code as a follow up?
>
> Also this needs to be explicitely enabled per architecture (opt-in) and
> not as an unconditional operation for all architectures which support
> CPU hotplug.
>
> Thanks,
>
>         tglx

Thanks for your comment.

I'll make this another config and depends on HOTPLUG_CPU.

I did some check on how architectures implement smp_send_stop. Most
architecture would loop through all other cpus in cpu_online_mask and
call ipi stop to each. If they enable this config, the loop would be
empty loop. In case they don't enable this config, they still need
original smp_send_stop (or as a fallback if some cpus fails to
offline).
Currently there are 2 architectures (csky, alpha) that call ipi on
possible cpus (instead of online cpus). Besides this, I'm not sure if
there's other architecture code that should be cleaned up.

Thanks,

Hsin-Yi

      reply	other threads:[~2020-01-10 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 23:26 [PATCH RFC v2] reboot: hotplug cpus in migrate_to_reboot_cpu() Hsin-Yi Wang
2020-01-09 20:15 ` Thomas Gleixner
2020-01-10 10:58   ` Hsin-Yi Wang [this message]

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=CAJMQK-ijrdcG-WKcNmgWu4ng5_TxrdYPr0TV0uAqS8UcFuL1ug@mail.gmail.com \
    --to=hsinyi@chromium.org \
    --cc=aaro.koskinen@nokia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=jkosina@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pkondeti@codeaurora.org \
    --cc=swboyd@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=zhenzhong.duan@oracle.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;
as well as URLs for NNTP newsgroup(s).