Uladzislau Rezki (Sony)
dfd3df31c9
mm/slab/kvfree_rcu: Switch to WQ_MEM_RECLAIM wq
Currently kvfree_rcu() APIs use a system workqueue which is
"system_unbound_wq" to driver RCU machinery to reclaim a memory.
Recently, it has been noted that the following kernel warning can
be observed:
<snip>
workqueue: WQ_MEM_RECLAIM nvme-wq:nvme_scan_work is flushing !WQ_MEM_RECLAIM events_unbound:kfree_rcu_work
WARNING: CPU: 21 PID: 330 at kernel/workqueue.c:3719 check_flush_dependency+0x112/0x120
Modules linked in: intel_uncore_frequency(E) intel_uncore_frequency_common(E) skx_edac(E) ...
CPU: 21 UID: 0 PID: 330 Comm: kworker/u144:6 Tainted: G E 6.13.2-0_g925d379822da #1
Hardware name: Wiwynn Twin Lakes MP/Twin Lakes Passive MP, BIOS YMM20 02/01/2023
Workqueue: nvme-wq nvme_scan_work
RIP: 0010:check_flush_dependency+0x112/0x120
Code: 05 9a 40 14 02 01 48 81 c6 c0 00 00 00 48 8b 50 18 48 81 c7 c0 00 00 00 48 89 f9 48 ...
RSP: 0018:ffffc90000df7bd8 EFLAGS: 00010082
RAX: 000000000000006a RBX: ffffffff81622390 RCX: 0000000000000027
RDX: 00000000fffeffff RSI: 000000000057ffa8 RDI: ffff88907f960c88
RBP: 0000000000000000 R08: ffffffff83068e50 R09: 000000000002fffd
R10: 0000000000000004 R11: 0000000000000000 R12: ffff8881001a4400
R13: 0000000000000000 R14: ffff88907f420fb8 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff88907f940000(0000) knlGS:0000000000000000
CR2: 00007f60c3001000 CR3: 000000107d010005 CR4: 00000000007726f0
PKRU: 55555554
Call Trace:
<TASK>
? __warn+0xa4/0x140
? check_flush_dependency+0x112/0x120
? report_bug+0xe1/0x140
? check_flush_dependency+0x112/0x120
? handle_bug+0x5e/0x90
? exc_invalid_op+0x16/0x40
? asm_exc_invalid_op+0x16/0x20
? timer_recalc_next_expiry+0x190/0x190
? check_flush_dependency+0x112/0x120
? check_flush_dependency+0x112/0x120
__flush_work.llvm.1643880146586177030+0x174/0x2c0
flush_rcu_work+0x28/0x30
kvfree_rcu_barrier+0x12f/0x160
kmem_cache_destroy+0x18/0x120
bioset_exit+0x10c/0x150
disk_release.llvm.6740012984264378178+0x61/0xd0
device_release+0x4f/0x90
kobject_put+0x95/0x180
nvme_put_ns+0x23/0xc0
nvme_remove_invalid_namespaces+0xb3/0xd0
nvme_scan_work+0x342/0x490
process_scheduled_works+0x1a2/0x370
worker_thread+0x2ff/0x390
? pwq_release_workfn+0x1e0/0x1e0
kthread+0xb1/0xe0
? __kthread_parkme+0x70/0x70
ret_from_fork+0x30/0x40
? __kthread_parkme+0x70/0x70
ret_from_fork_asm+0x11/0x20
</TASK>
---[ end trace 0000000000000000 ]---
<snip>
To address this switch to use of independent WQ_MEM_RECLAIM
workqueue, so the rules are not violated from workqueue framework
point of view.
Apart of that, since kvfree_rcu() does reclaim memory it is worth
to go with WQ_MEM_RECLAIM type of wq because it is designed for
this purpose.
Fixes: 6c6c47b063 ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"),
Reported-by: Keith Busch <kbusch@kernel.org>
Closes: https://lore.kernel.org/all/Z7iqJtCjHKfo8Kho@kbusch-mbp/
Cc: stable@vger.kernel.org
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
2025-03-04 08:51:53 +01:00
..
2025-01-25 20:22:46 -08:00
2025-01-25 20:22:46 -08:00
2025-02-01 03:53:26 -08:00
2025-01-25 20:22:38 -08:00
2024-05-05 17:53:51 -07:00
2024-07-03 19:30:00 -07:00
2024-11-07 14:38:07 -08:00
2024-02-22 10:24:57 -08:00
2024-11-14 22:49:19 -08:00
2025-01-13 22:40:35 -08:00
2025-02-01 03:53:25 -08:00
2024-04-25 20:56:04 -07:00
2024-09-17 01:07:01 -07:00
2025-01-25 20:22:23 -08:00
2024-07-03 19:29:58 -07:00
2023-12-05 11:17:58 +01:00
2025-01-13 22:40:59 -08:00
2024-11-07 14:25:16 -08:00
2024-11-03 01:28:06 -05:00
2024-09-01 20:43:33 -07:00
2024-09-01 20:43:33 -07:00
2025-01-26 18:36:23 -08:00
2024-11-05 11:14:32 +01:00
2025-02-01 03:53:27 -08:00
2024-07-03 19:30:06 -07:00
2024-07-12 15:52:15 -07:00
2025-01-25 20:22:41 -08:00
2025-01-25 20:22:42 -08:00
2025-01-28 13:48:37 +01:00
2023-10-25 16:47:14 -07:00
2025-02-01 03:53:27 -08:00
2024-07-03 19:29:58 -07:00
2025-01-13 22:40:50 -08:00
2025-01-25 20:22:43 -08:00
2025-01-25 20:22:21 -08:00
2024-08-27 14:12:51 +02:00
2025-01-26 18:36:23 -08:00
2025-02-01 03:53:25 -08:00
2025-01-25 20:22:40 -08:00
2024-12-30 17:59:10 -08:00
2024-11-11 00:26:44 -08:00
2025-01-13 22:40:48 -08:00
2025-01-13 22:40:48 -08:00
2025-01-25 20:22:38 -08:00
2025-01-13 22:40:40 -08:00
2024-12-05 19:54:46 -08:00
2025-01-25 20:22:35 -08:00
2025-01-25 20:22:40 -08:00
2025-01-25 20:22:21 -08:00
2025-01-28 13:48:37 +01:00
2024-09-26 14:01:44 -07:00
2025-01-26 18:36:23 -08:00
2025-01-25 20:22:41 -08:00
2024-06-05 19:19:26 -07:00
2024-05-05 17:53:49 -07:00
2024-03-13 12:12:21 -07:00
2024-09-09 16:39:03 -07:00
2025-01-25 20:22:45 -08:00
2024-07-12 15:52:15 -07:00
2024-11-07 14:14:58 -08:00
2025-01-25 20:22:30 -08:00
2025-01-13 22:40:34 -08:00
2025-01-25 20:22:38 -08:00
2025-01-25 20:22:23 -08:00
2024-09-01 20:25:54 -07:00
2024-09-01 20:25:55 -07:00
2024-11-11 00:26:44 -08:00
2025-01-12 19:03:37 -08:00
2025-01-13 22:40:51 -08:00
2024-12-11 17:28:41 +01:00
2025-01-25 20:22:29 -08:00
2025-01-25 20:22:29 -08:00
2025-01-25 20:22:38 -08:00
2025-01-28 13:48:37 +01:00
2025-01-28 13:48:37 +01:00
2025-01-06 17:24:38 +01:00
2024-08-15 22:16:14 -07:00
2025-01-13 22:40:31 -08:00
2025-01-25 20:22:19 -08:00
2025-01-25 20:22:36 -08:00
2025-01-13 22:40:44 -08:00
2024-05-19 14:40:44 -07:00
2023-12-10 16:51:50 -08:00
2024-01-08 15:27:15 -08:00
2024-06-15 10:43:04 -07:00
2024-11-07 14:38:07 -08:00
2025-01-28 13:48:37 +01:00
2024-11-11 00:26:44 -08:00
2024-07-10 12:14:54 -07:00
2024-04-25 20:55:49 -07:00
2025-01-25 20:22:38 -08:00
2024-12-18 19:04:43 -08:00
2024-11-05 16:56:23 -08:00
2025-01-13 22:40:48 -08:00
2024-02-22 10:24:47 -08:00
2025-01-26 18:36:23 -08:00
2024-11-07 14:38:07 -08:00
2025-01-13 22:40:38 -08:00
2025-01-27 19:25:45 -05:00
2024-09-01 20:25:45 -07:00
2025-01-26 18:36:23 -08:00
2024-11-07 14:38:08 -08:00
2025-01-15 13:14:37 +01:00
2024-10-31 20:27:04 -07:00
2024-01-08 15:27:15 -08:00
2025-03-04 08:51:53 +01:00
2025-01-13 10:22:04 +01:00
2025-01-28 12:25:12 -08:00
2025-01-25 20:22:30 -08:00
2025-01-25 20:22:38 -08:00
2025-01-25 20:22:19 -08:00
2025-01-25 20:22:37 -08:00
2025-01-25 20:22:21 -08:00
2025-01-25 20:22:43 -08:00
2024-09-17 01:07:01 -07:00
2025-02-01 03:53:26 -08:00
2025-01-25 20:22:43 -08:00
2025-01-13 22:40:46 -08:00
2025-01-13 22:40:59 -08:00
2025-01-13 22:40:42 -08:00
2025-01-25 20:22:38 -08:00
2025-01-25 20:22:38 -08:00
2025-01-25 20:22:31 -08:00
2023-11-28 14:08:38 +01:00
2025-02-01 03:53:24 -08:00
2025-01-12 19:03:38 -08:00
2025-01-25 20:22:39 -08:00
2024-09-01 20:25:56 -07:00
2024-04-25 20:55:48 -07:00
2025-01-25 20:22:35 -08:00
2024-04-25 20:55:48 -07:00
2025-02-01 03:53:23 -08:00
2025-01-26 18:36:23 -08:00