[PATCH] workqueue: relax condition in __queue_work()
From: NVIDIA
Date: Mon Jun 30 2025 - 13:47:49 EST
Some cpumask search functions may return a number greater than
nr_cpu_ids when nothing is found. Adjust __queue_work() to it.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@xxxxxxxxx>
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 9f9148075828..abacfe157fe6 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2261,7 +2261,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
rcu_read_lock();
retry:
/* pwq which will be used unless @work is executing elsewhere */
- if (req_cpu == WORK_CPU_UNBOUND) {
+ if (req_cpu >= WORK_CPU_UNBOUND) {
if (wq->flags & WQ_UNBOUND)
cpu = wq_select_unbound_cpu(raw_smp_processor_id());
else
--
2.43.0