Skip to contentSkip to conversation

workqueue: Removed double allocation of wq_update_pod_attrs_buf

PATCH Applied Steven Rostedt 3 participants 3 messages Sep 5, 2023 – Sep 18, 2023 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: Removed double allocation of wq_update_pod_attrs_buf

From: "Steven Rostedt (Google)" <[email protected]>

First commit 2930155b2e272 ("workqueue: Initialize unbound CPU pods later in the boot") added the initialization of wq_update_pod_attrs_buf to workqueue_init_early(), and then latter on, commit 84193c07105c6 ("workqueue: Generalize unbound CPU pods") added it as well. This appeared in a kmemleak run where the second allocation made the first allocation leak.

Fixes 84193c07105c6 ("workqueue: Generalize unbound CPU pods")
---
 kernel/workqueue.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/workqueue.c +0 -3
index c85825e17df8..129328b765fb 100644
@@ -6535,9 +6535,6 @@ void __init workqueue_init_early(void)
 
 	BUG_ON(!zalloc_cpumask_var_node(&pt->pod_cpus[0], GFP_KERNEL, NUMA_NO_NODE));
 
-	wq_update_pod_attrs_buf = alloc_workqueue_attrs();
-	BUG_ON(!wq_update_pod_attrs_buf);
-
 	pt->nr_pods = 1;
 	cpumask_copy(pt->pod_cpus[0], cpu_possible_mask);
 	pt->pod_node[0] = NUMA_NO_NODE;
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Steven Rostedt

From: "Steven Rostedt (Google)" <[email protected]>

First commit 2930155b2e272 ("workqueue: Initialize unbound CPU pods later in the boot") added the initialization of wq_update_pod_attrs_buf to workqueue_init_early(), and then latter on, commit 84193c07105c6 ("workqueue: Generalize unbound CPU pods") added it as well. This appeared in a kmemleak run where the second allocation made the first allocation leak.

Fixes 84193c07105c6 ("workqueue: Generalize unbound CPU pods")

Just noticed this, too.
John posted a similar patch after you:
https://lore.kernel.org/all/[email protected]/

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Applied
#2 lore raw
In reply to Steven Rostedt
Quoted 11 lines · Steven Rostedt

From: "Steven Rostedt (Google)" <[email protected]>

First commit 2930155b2e272 ("workqueue: Initialize unbound CPU pods later in the boot") added the initialization of wq_update_pod_attrs_buf to workqueue_init_early(), and then latter on, commit 84193c07105c6 ("workqueue: Generalize unbound CPU pods") added it as well. This appeared in a kmemleak run where the second allocation made the first allocation leak.

Fixes 84193c07105c6 ("workqueue: Generalize unbound CPU pods")

Applied to wq/for-6.6-fixes.

Thanks.

Signature · 1 line
tejun