diff options
author | Imran Khan <imran.f.khan@oracle.com> | 2025-01-10 00:27:11 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2025-01-10 19:33:39 +0100 |
commit | da30ba227c41762ac98e993a1453460450b3e642 (patch) | |
tree | 2ba32c4bb6118f4e0a00f13d609a9ac6e41df6c9 /kernel/bpf/core.c | |
parent | workqueue: add printf attribute to __alloc_workqueue() (diff) | |
download | linux-da30ba227c41762ac98e993a1453460450b3e642.tar.xz linux-da30ba227c41762ac98e993a1453460450b3e642.zip |
workqueue: warn if delayed_work is queued to an offlined cpu.
delayed_work submitted to an offlined cpu, will not get executed,
after the specified delay if the cpu remains offline. If the cpu
never comes online the work will never get executed.
checking for online cpu in __queue_delayed_work, does not sound
like a good idea because to do this reliably we need hotplug lock
and since work may be submitted from atomic contexts, we would
have to use cpus_read_trylock. But if trylock fails we would queue
the work on any cpu and this may not be optimal because our intended
cpu might still be online.
Putting a WARN_ON_ONCE for an already offlined cpu, will indicate users
of queue_delayed_work_on, if they are (wrongly) trying to queue
delayed_work on offlined cpu. Also indicate the problem of using
offlined cpu with queue_delayed_work_on, in its description.
Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/bpf/core.c')
0 files changed, 0 insertions, 0 deletions