[PATCH] workqueue: Simplify pool_allowed_cpus()

From: Lai Jiangshan
Date: Thu Jul 11 2024 - 04:37:37 EST


From: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx>

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.

Signed-off-by: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx>
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 8b2a0fe4a85e..5d362290c2e8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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;
--
2.19.1.6.gb485710b