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

2021-02-11 Thread Alexey Klimov
On Fri, Feb 5, 2021 at 12:41 AM Daniel Jordan wrote: > > Peter Zijlstra 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 > >> userspac

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

2021-02-11 Thread Alexey Klimov
On Fri, Feb 5, 2021 at 11:22 AM Qais Yousef wrote: > > On 02/04/21 10:46, Peter Zijlstra wrote: > > On Thu, Feb 04, 2021 at 01:01:57AM +, Alexey Klimov wrote: > > > @@ -1281,6 +1282,11 @@ static int cpu_up(unsigned int cpu, enum > > > cpuhp_state target) > > > err = _cpu_up(cpu, 0, target

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

2021-02-05 Thread Qais Yousef
On 02/04/21 10:46, Peter Zijlstra wrote: > On Thu, Feb 04, 2021 at 01:01:57AM +, Alexey Klimov wrote: > > @@ -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

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

2021-02-04 Thread Daniel Jordan
Alexey Klimov writes: > When a CPU offlined and onlined via device_offline() and device_online() > the userspace gets uevent notification. If, after receiving "online" uevent, > userspace executes sched_setaffinity() on some task trying to move it > to a recently onlined CPU, then it often fails

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

2021-02-04 Thread Daniel Jordan
Peter Zijlstra writes: > On Thu, Feb 04, 2021 at 12:50:34PM +, Alexey Klimov wrote: >> On Thu, Feb 4, 2021 at 9:46 AM Peter Zijlstra wrote: >> > >> > On Thu, Feb 04, 2021 at 01:01:57AM +, Alexey Klimov wrote: >> > > @@ -1281,6 +1282,11 @@ static int cpu_up(unsigned int cpu, enum >> > >

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

2021-02-04 Thread Peter Zijlstra
On Thu, Feb 04, 2021 at 12:50:34PM +, Alexey Klimov wrote: > On Thu, Feb 4, 2021 at 9:46 AM Peter Zijlstra wrote: > > > > On Thu, Feb 04, 2021 at 01:01:57AM +, Alexey Klimov wrote: > > > @@ -1281,6 +1282,11 @@ static int cpu_up(unsigned int cpu, enum > > > cpuhp_state target) > > >

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

2021-02-04 Thread Alexey Klimov
On Thu, Feb 4, 2021 at 9:46 AM Peter Zijlstra wrote: > > On Thu, Feb 04, 2021 at 01:01:57AM +, Alexey Klimov wrote: > > @@ -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();

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

2021-02-04 Thread Peter Zijlstra
On Thu, Feb 04, 2021 at 01:01:57AM +, Alexey Klimov wrote: > @@ -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) > +

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

2021-02-03 Thread Alexey Klimov
When a CPU offlined and onlined via device_offline() and device_online() the userspace gets uevent notification. If, after receiving "online" uevent, userspace executes sched_setaffinity() on some task trying to move it to a recently onlined CPU, then it often fails with -EINVAL. Userspace needs to