lkml.org 
[lkml]   [2020]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RFC v2] reboot: hotplug cpus in migrate_to_reboot_cpu()
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

\
 
 \ /
  Last update: 2020-01-10 11:59    [W:0.046 / U:6.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site