Lai Jiangshan
91f098704c
workqueue: Fix divide error in wq_update_node_max_active()
Yue Sun and xingwei lee reported a divide error bug in
wq_update_node_max_active():
divide error: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 PID: 21 Comm: cpuhp/1 Not tainted 6.9.0-rc5 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:wq_update_node_max_active+0x369/0x6b0 kernel/workqueue.c:1605
Code: 24 bf 00 00 00 80 44 89 fe e8 83 27 33 00 41 83 fc ff 75 0d 41
81 ff 00 00 00 80 0f 84 68 01 00 00 e8 fb 22 33 00 44 89 f8 99 <41> f7
fc 89 c5 89 c7 44 89 ee e8 a8 24 33 00 89 ef 8b 5c 24 04 89
RSP: 0018:ffffc9000018fbb0 EFLAGS: 00010293
RAX: 00000000000000ff RBX: 0000000000000001 RCX: ffff888100ada500
RDX: 0000000000000000 RSI: 00000000000000ff RDI: 0000000080000000
RBP: 0000000000000001 R08: ffffffff815b1fcd R09: 1ffff1100364ad72
R10: dffffc0000000000 R11: ffffed100364ad73 R12: 0000000000000000
R13: 0000000000000100 R14: 0000000000000000 R15: 00000000000000ff
FS: 0000000000000000(0000) GS:ffff888135c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb8c06ca6f8 CR3: 000000010d6c6000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
workqueue_offline_cpu+0x56f/0x600 kernel/workqueue.c:6525
cpuhp_invoke_callback+0x4e1/0x870 kernel/cpu.c:194
cpuhp_thread_fun+0x411/0x7d0 kernel/cpu.c:1092
smpboot_thread_fn+0x544/0xa10 kernel/smpboot.c:164
kthread+0x2ed/0x390 kernel/kthread.c:388
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:244
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
After analysis, it happens when all of the CPUs in a workqueue's affinity
get offine.
The problem can be easily reproduced by:
# echo 8 > /sys/devices/virtual/workqueue/<any-wq-name>/cpumask
# echo 0 > /sys/devices/system/cpu/cpu3/online
Use the default max_actives for nodes when all of the CPUs in the
workqueue's affinity get offline to fix the problem.
Reported-by: Yue Sun <samsun1006219@gmail.com>
Reported-by: xingwei lee <xrivendell7@gmail.com>
Link: https://lore.kernel.org/lkml/CAEkJfYPGS1_4JqvpSo0=FM0S1ytB8CEbyreLTtWpR900dUZymw@mail.gmail.com/
Fixes: 5797b1c189 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
Cc: stable@vger.kernel.org
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2024-04-24 07:23:06 -10:00
..
2024-03-31 11:23:51 -07:00
2024-03-12 17:44:08 -07:00
2024-03-12 17:44:08 -07:00
2024-01-17 17:19:06 +00:00
2024-03-24 10:45:31 -07:00
2024-03-12 13:23:32 +01:00
2024-03-14 17:43:30 -07:00
2024-01-19 12:58:17 +01:00
2023-10-18 14:43:22 -07:00
2024-03-25 23:45:21 +01:00
2023-10-18 14:34:17 -07:00
2023-09-20 11:24:18 +02:00
2024-03-01 13:02:05 +01:00
2024-03-25 10:48:23 -07:00
2024-03-21 17:16:46 -07:00
2024-03-26 09:25:57 -07:00
2024-02-26 17:37:25 -08:00
2024-03-22 10:41:13 -07:00
2024-03-27 09:03:22 -07:00
2024-03-27 10:01:24 -07:00
2023-09-11 15:05:50 +02:00
2024-02-09 11:13:59 -10:00
2022-08-22 18:50:06 -04:00
2023-11-02 20:53:31 -10:00
2023-11-14 17:34:27 -05:00
2024-01-25 10:12:22 -05:00
2023-07-21 12:17:25 -04:00
2024-01-25 09:59:27 -05:00
2023-10-13 18:34:46 +02:00
2024-02-05 13:22:34 -10:00
2024-02-22 15:38:51 -08:00
2023-08-08 16:48:47 -04:00
2022-09-26 10:13:13 -07:00
2023-03-14 19:32:38 -07:00
2024-02-14 07:53:50 -08:00
2023-01-13 11:48:15 +01:00
2024-03-11 15:45:55 -07:00
2024-02-23 17:48:22 -08:00
2024-03-26 11:14:12 -07:00
2024-02-23 17:33:31 -05:00
2023-04-18 16:39:34 -07:00
2024-02-23 17:48:22 -08:00
2024-03-11 10:21:06 -07:00
2023-09-21 12:03:50 -06:00
2023-02-08 13:36:22 +01:00
2024-03-11 12:02:50 -07:00
2023-12-23 15:52:13 +01:00
2023-05-28 16:20:21 +09:00
2023-09-29 11:28:39 -07:00
2024-03-13 21:22:04 -04:00
2023-08-21 13:37:28 -07:00
2023-03-24 11:01:29 +01:00
2022-12-01 15:53:05 -08:00
2022-11-12 18:47:36 -08:00
2024-02-23 17:48:19 -08:00
2022-11-15 00:42:02 -08:00
2023-08-25 15:00:36 -07:00
2023-10-19 11:02:48 +02:00
2024-02-23 17:48:22 -08:00
2023-06-09 17:44:17 -07:00
2024-03-14 18:03:09 -07:00
2024-02-23 17:48:23 -08:00
2024-02-23 17:48:22 -08:00
2024-02-23 17:48:22 -08:00
2023-03-24 20:10:59 -07:00
2024-02-08 23:29:29 +09:00
2023-06-08 12:27:20 -07:00
2024-03-21 13:34:15 -07:00
2023-11-02 20:53:31 -10:00
2022-09-11 21:55:12 -07:00
2024-02-23 17:48:22 -08:00
2023-04-08 13:45:38 -07:00
2024-03-01 12:23:37 +01:00
2023-12-20 19:26:30 -05:00
2024-03-06 13:04:17 -08:00
2024-03-14 18:03:09 -07:00
2023-12-01 09:51:44 -08:00
2023-12-20 19:26:31 -05:00
2023-08-21 13:37:59 -07:00
2024-03-13 12:53:53 -07:00
2022-09-11 21:55:12 -07:00
2024-02-22 15:38:52 -08:00
2024-01-09 16:20:17 -08:00
2023-12-29 12:22:27 -08:00
2024-01-09 11:46:20 -08:00
2022-12-27 12:52:12 +01:00
2023-07-14 15:02:57 -07:00
2022-11-09 18:06:35 +00:00
2023-12-12 14:24:14 +01:00
2024-03-14 18:03:09 -07:00
2023-10-30 17:56:53 -10:00
2023-10-04 10:41:57 -07:00
2024-02-29 11:51:24 -10:00
2023-04-20 11:36:35 +02:00
2023-12-29 12:22:29 -08:00
2022-10-17 16:41:16 +02:00
2024-01-09 12:57:46 -08:00
2024-03-26 11:07:22 -07:00
2022-09-08 16:56:45 -07:00
2024-03-18 10:33:06 -04:00
2023-09-19 13:21:32 -07:00
2023-10-04 10:41:57 -07:00
2023-09-24 17:24:01 +02:00
2023-02-18 14:34:36 -05:00
2023-08-15 15:26:17 -07:00
2023-06-29 15:19:43 -07:00
2023-09-13 14:59:24 +02:00
2024-02-22 15:38:52 -08:00
2023-10-11 08:46:01 -07:00
2023-04-13 11:49:35 -07:00
2023-06-08 15:43:09 -04:00
2024-03-04 17:01:27 -08:00
2023-12-21 13:17:54 +01:00
2023-06-19 16:25:28 -07:00
2023-06-09 17:44:21 -07:00
2024-03-12 13:09:23 -07:00
2023-08-07 15:57:22 -10:00
2024-04-24 07:23:06 -10:00