Skip to contentSkip to conversation

workqueue: Simplify pool_allowed_cpus()

PATCH Applied Lai Jiangshan 2 participants 2 messages Jul 11, 2024 Workqueue

lore
Share & tools
lore

Lai Jiangshan

author reviewer
#0 lore raw

PATCH 1/1 workqueue: Simplify pool_allowed_cpus()

From: Lai Jiangshan <[email protected]>

For cpu worker pools, attrs->affn_strict is true; attrs->__pod_cpumask and attrs->cpumask are the same. Skip the pool->cpu test in pool_allowed_cpus() and use pool->attrs->__pod_cpumask.

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index 8b2a0fe4a85e..5d362290c2e8 100644
@@ -2646,7 +2646,7 @@ static struct worker *alloc_worker(int node)
 
 static cpumask_t *pool_allowed_cpus(struct worker_pool *pool)
 {
-	if (pool->cpu < 0 && pool->attrs->affn_strict)
+	if (pool->attrs->affn_strict)
 		return pool->attrs->__pod_cpumask;
 	else
 		return pool->attrs->cpumask;
Signature · 1 line
2.19.1.6.gb485710b
maintainer Applied
#1 lore raw
Quoted 7 lines · Lai Jiangshan

From: Lai Jiangshan <[email protected]>

For cpu worker pools, attrs->affn_strict is true; attrs->__pod_cpumask and attrs->cpumask are the same. Skip the pool->cpu test in pool_allowed_cpus() and use pool->attrs->__pod_cpumask.

Applied to wq/for-6.11.

Thanks.

Signature · 1 line
tejun