workqueue: Removed double allocation of wq_update_pod_attrs_buf
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.
--- kernel/workqueue.c | 3 --- 1 file changed, 3 deletions(-)
kernel/workqueue.c +0 -3
@@ -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
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 ofwq_update_pod_attrs_buftoworkqueue_init_early(), and then latter on, commit84193c07105c6("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")Signed-off-by Steven Rostedt (Google) <[email protected]>
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
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 ofwq_update_pod_attrs_buftoworkqueue_init_early(), and then latter on, commit84193c07105c6("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")Signed-off-by Steven Rostedt (Google) <[email protected]>
Applied to wq/for-6.6-fixes.
Thanks.
Signature · 1 line
tejun