workqueue: Fix queue_work_on() with BH workqueues
authorTejun Heo <tj@kernel.org>
Wed, 14 Feb 2024 18:33:55 +0000 (08:33 -1000)
committerTejun Heo <tj@kernel.org>
Wed, 14 Feb 2024 18:33:55 +0000 (08:33 -1000)
commit2f34d7337d98f3eae7bd3d1270efaf9d8a17cfc6
treeba618a794f4b55650672325b5c76d2d8e1cb0f05
parentbf52b1ac6ab41a060511d56d0f2da12f3a2486db
workqueue: Fix queue_work_on() with BH workqueues

When queue_work_on() is used to queue a BH work item on a remote CPU, the
work item is queued on that CPU but kick_pool() raises softirq on the local
CPU. This leads to stalls as the work item won't be executed until something
else on the remote CPU schedules a BH work item or tasklet locally.

Fix it by bouncing raising softirq to the target CPU using per-cpu irq_work.

Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 4cb1ef64609f ("workqueue: Implement BH workqueues to eventually replace tasklets")
kernel/workqueue.c