Thread (9 messages) 9 messages, 4 authors, 2021-02-11

Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining

From: Alexey Klimov <hidden>
Date: 2021-02-04 12:52:26
Also in: lkml

On Thu, Feb 4, 2021 at 9:46 AM Peter Zijlstra [off-list ref] wrote:
On Thu, Feb 04, 2021 at 01:01:57AM +0000, Alexey Klimov wrote:
quoted
@@ -1281,6 +1282,11 @@ static int cpu_up(unsigned int cpu, enum cpuhp_state target)
      err = _cpu_up(cpu, 0, target);
 out:
      cpu_maps_update_done();
+
+     /* To avoid out of line uevent */
+     if (!err)
+             cpuset_wait_for_hotplug();
+
      return err;
 }
quoted
@@ -2071,14 +2075,18 @@ static void cpuhp_online_cpu_device(unsigned int cpu)
      struct device *dev = get_cpu_device(cpu);

      dev->offline = false;
-     /* Tell user space about the state change */
-     kobject_uevent(&dev->kobj, KOBJ_ONLINE);
 }
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).
Or is there a concern that now the uevents are sent in a row
sequentially which might abuse userspace uevents handling machinery?

Best regards,
Alexey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help