mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] workqueue: Simplify pool_allowed_cpus()
@ 2024-07-11  8:38 Lai Jiangshan
  2024-07-11 17:21 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2024-07-11  8:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lai Jiangshan, Tejun Heo, Lai Jiangshan

From: Lai Jiangshan <jiangshan.ljs@antgroup.com>

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@antgroup.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] workqueue: Simplify pool_allowed_cpus()
  2024-07-11  8:38 [PATCH] workqueue: Simplify pool_allowed_cpus() Lai Jiangshan
@ 2024-07-11 17:21 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-07-11 17:21 UTC (permalink / raw)
  To: Lai Jiangshan; +Cc: linux-kernel, Lai Jiangshan

On Thu, Jul 11, 2024 at 04:38:31PM +0800, Lai Jiangshan wrote:
> From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> 
> 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@antgroup.com>

Applied to wq/for-6.11.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-11 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-11  8:38 [PATCH] workqueue: Simplify pool_allowed_cpus() Lai Jiangshan
2024-07-11 17:21 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®