]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: Restrict affinity change to rescuer
authorPeter Zijlstra <peterz@infradead.org>
Fri, 15 Jan 2021 18:08:36 +0000 (19:08 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 22 Jan 2021 14:09:43 +0000 (15:09 +0100)
commitb1d1f3c8c0ed5c05ac210a98caf615ba2d5edbdc
tree843671442486fff2c92b7b7df424524a2f4fd96a
parent9ed6332184468a0a42503999ebb566a2be6897d0
workqueue: Restrict affinity change to rescuer

create_worker() will already set the right affinity using
kthread_bind_mask(), this means only the rescuer will need to change
it's affinity.

Howveer, while in cpu-hot-unplug a regular task is not allowed to run
on online&&!active as it would be pushed away quite agressively. We
need KTHREAD_IS_PER_CPU to survive in that environment.

Therefore set the affinity after getting that magic flag.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210121103506.826629830@infradead.org
kernel/workqueue.c