Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining
From: Alexey Klimov
Date: Thu Feb 11 2021 - 09:24:36 EST
On Fri, Feb 5, 2021 at 12:41 AM Daniel Jordan
<daniel.m.jordan@xxxxxxxxxx> wrote:
>
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:
[...]
> >> > One concequence of this is that you'll now get a bunch of notifications
> >> > across things like suspend/hybernate.
> >>
> >> The patch doesn't change the number of kobject_uevent()s. The
> >> userspace will get the same number of uevents as before the patch (at
> >> least if I can rely on my eyes).
> >
> > bringup_hibernate_cpu() didn't used to generate an event, it does now.
> > Same for bringup_nonboot_cpus().
>
> Both of those call cpu_up(), which only gets a cpuset_wait_for_hotplug()
> in this patch. No new events generated from that, right, it's just a
> wrapper for a flush_work()?
>
> > Also, looking again, you don't seem to be reinstating the OFFLINE event
> > you took out.
>
> It seems to be reinstated in cpuhp_smt_disable()?
Peter, what Daniel said.
cpuset_wait_for_hotplug() doesn't generate an event.
The offline event was moved below in the same function:
+
+ /* Tell user space about the state changes */
+ for_each_cpu(cpu, mask) {
+ dev = get_cpu_device(cpu);
+ kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
+ }
+
+ free_cpumask_var(mask);
Daniel,
thanks for your comments. I'll update the patch and resend.
Best regards,
Alexey