Skip to contentSkip to conversation

workqueue: fix duplicate wq_update_pod_attrs_buf allocation

PATCH In review John Ogness 4 participants 4 messages Sep 13, 2023 – Sep 18, 2023 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: fix duplicate wq_update_pod_attrs_buf allocation

One of the hunks for the patch resulting in
commit 84193c07105c ("workqueue: Generalize unbound CPU pods") was applied incorrectly. This resulted in @wq_update_pod_attrs_buf being allocated twice.

From the kmemleak detector:

unreferenced object 0xc0000000040074c0 (size 64):
comm "swapper/0", pid 0, jiffies 4294937296 (age 1936.580s) hex dump (first 32 bytes):

    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000076b83a6e>] .kmalloc_trace+0x54/0x190
    [<00000000898f2356>] .alloc_workqueue_attrs+0x2c/0x60
    [<0000000063365e1f>] .workqueue_init_early+0xe4/0x4b8
    [<00000000ca97ff39>] .start_kernel+0x8d0/0xba4
    [<000000002ee12080>] start_here_common+0x1c/0x20

Remove the redundant allocation.

---
 kernel/workqueue.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/workqueue.c +0 -3
index c85825e17df8..43ab8399b72b 100644
@@ -6524,9 +6524,6 @@ void __init workqueue_init_early(void)
 
 	pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
 
-	wq_update_pod_attrs_buf = alloc_workqueue_attrs();
-	BUG_ON(!wq_update_pod_attrs_buf);
-
 	/* initialize WQ_AFFN_SYSTEM pods */
 	pt->pod_cpus = kcalloc(1, sizeof(pt->pod_cpus[0]), GFP_KERNEL);
 	pt->pod_node = kcalloc(1, sizeof(pt->pod_node[0]), GFP_KERNEL);

base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec

Signature · 1 line
2.39.2
#1 lore raw
Quoted 19 lines · John Ogness

One of the hunks for the patch resulting in
commit 84193c07105c ("workqueue: Generalize unbound CPU pods") was applied incorrectly. This resulted in @wq_update_pod_attrs_buf being allocated twice.

From the kmemleak detector:

unreferenced object 0xc0000000040074c0 (size 64):
comm "swapper/0", pid 0, jiffies 4294937296 (age 1936.580s) hex dump (first 32 bytes):

    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000076b83a6e>] .kmalloc_trace+0x54/0x190
    [<00000000898f2356>] .alloc_workqueue_attrs+0x2c/0x60
    [<0000000063365e1f>] .workqueue_init_early+0xe4/0x4b8
    [<00000000ca97ff39>] .start_kernel+0x8d0/0xba4
    [<000000002ee12080>] start_here_common+0x1c/0x20
Quoted 3 lines

Remove the redundant allocation.

Stephen posted a similar patch before:
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
#2 lore raw
Quoted 20 lines · Geert Uytterhoeven
Quoted 19 lines · John Ogness

One of the hunks for the patch resulting in
commit 84193c07105c ("workqueue: Generalize unbound CPU pods") was applied incorrectly. This resulted in @wq_update_pod_attrs_buf being allocated twice.

From the kmemleak detector:

unreferenced object 0xc0000000040074c0 (size 64):
comm "swapper/0", pid 0, jiffies 4294937296 (age 1936.580s) hex dump (first 32 bytes):

    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000076b83a6e>] .kmalloc_trace+0x54/0x190
    [<00000000898f2356>] .alloc_workqueue_attrs+0x2c/0x60
    [<0000000063365e1f>] .workqueue_init_early+0xe4/0x4b8
    [<00000000ca97ff39>] .start_kernel+0x8d0/0xba4
    [<000000002ee12080>] start_here_common+0x1c/0x20
Quoted 6 lines
Quoted 3 lines

Remove the redundant allocation.

Stephen posted a similar patch before:
https://lore.kernel.org/all/[email protected]

I tripped over this kmemleak report too. It'd be nice to get this into -rc2. Tejun, are able to get this or the Sep 5th patch to Linus soon?

-Kees

Signature · 1 line
Kees Cook
maintainer
#3 lore raw
Quoted 5 lines · Kees Cook
Quoted 2 lines

Stephen posted a similar patch before:
https://lore.kernel.org/all/[email protected]

I tripped over this kmemleak report too. It'd be nice to get this into -rc2. Tejun, are able to get this or the Sep 5th patch to Linus soon?

Applied Stephen's one. Sorry about the delay. Have been seek for a few weeks.

Thanks.

Signature · 1 line
tejun