Sechang Lim
4406942e65
bpf: Fix RCU stall in bpf_fd_array_map_clear()
Add a missing cond_resched() in bpf_fd_array_map_clear() loop.
For PROG_ARRAY maps with many entries this loop calls
prog_array_map_poke_run() per entry which can be expensive, and
without yielding this can cause RCU stalls under load:
rcu: Stack dump where RCU GP kthread last ran:
CPU: 0 UID: 0 PID: 30932 Comm: kworker/0:2 Not tainted 6.14.0-13195-g967e8def1100 #2 PREEMPT(undef)
Workqueue: events prog_array_map_clear_deferred
RIP: 0010:write_comp_data+0x38/0x90 kernel/kcov.c:246
Call Trace:
<TASK>
prog_array_map_poke_run+0x77/0x380 kernel/bpf/arraymap.c:1096
__fd_array_map_delete_elem+0x197/0x310 kernel/bpf/arraymap.c:925
bpf_fd_array_map_clear kernel/bpf/arraymap.c:1000 [inline]
prog_array_map_clear_deferred+0x119/0x1b0 kernel/bpf/arraymap.c:1141
process_one_work+0x898/0x19d0 kernel/workqueue.c:3238
process_scheduled_works kernel/workqueue.c:3319 [inline]
worker_thread+0x770/0x10b0 kernel/workqueue.c:3400
kthread+0x465/0x880 kernel/kthread.c:464
ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153
ret_from_fork_asm+0x19/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Reviewed-by: Sun Jian <sun.jian.kdev@gmail.com>
Fixes: da765a2f59 ("bpf: Add poke dependency tracking for prog array maps")
Signed-off-by: Sechang Lim <rhkrqnwk98@gmail.com>
Link: https://lore.kernel.org/r/20260407103823.3942156-1-rhkrqnwk98@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-04-10 12:10:06 -07:00
..
2026-04-10 12:10:06 -07:00
2026-03-31 09:14:13 -10:00
2026-02-23 11:18:48 -08:00
2026-02-21 01:02:28 -08:00
2026-03-20 12:05:56 +01:00
2026-01-30 15:40:05 +01:00
2026-03-12 11:29:16 +01:00
2026-03-28 13:54:02 +01:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-26 09:54:08 -08:00
2026-02-21 17:09:51 -08:00
2026-02-24 11:13:26 -08:00
2026-02-22 08:26:33 -08:00
2026-02-23 19:37:28 +00:00
2026-03-23 13:54:53 +01:00
2026-02-21 17:09:51 -08:00
2026-03-25 09:00:05 -07:00
2026-03-31 14:23:12 -07:00
2026-03-24 23:17:14 +01:00
2026-04-07 16:27:52 -07:00
2026-02-21 20:03:00 -08:00
2025-06-24 20:30:37 +09:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2025-10-22 19:28:06 -04:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2025-12-03 16:53:19 +01:00
2025-07-31 18:23:53 -07:00
2026-01-01 16:39:46 +08:00
2025-11-14 10:01:52 +01:00
2026-02-17 09:46:03 -08:00
2025-09-13 17:32:55 -07:00
2026-02-21 17:09:51 -08:00
2026-03-10 16:01:48 -07:00
2025-11-12 10:00:15 -08:00
2026-01-06 20:52:57 -05:00
2026-02-08 00:13:32 -08:00
2026-02-26 10:45:49 +01:00
2026-02-21 17:09:51 -08:00
2026-03-11 12:01:07 +01:00
2025-10-30 20:10:27 +01:00
2025-08-06 10:23:36 +09:00
2026-02-21 01:02:28 -08:00
2025-11-20 14:03:43 -08:00
2026-01-22 15:58:22 -07:00
2026-02-21 17:09:51 -08:00
2026-02-12 12:13:01 -08:00
2025-11-27 14:24:33 -08:00
2026-01-08 12:43:57 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-31 16:16:07 -08:00
2025-08-02 12:01:38 -07:00
2026-02-21 17:09:51 -08:00
2026-03-13 23:15:26 +09:00
2025-11-27 15:44:53 +01:00
2025-11-27 14:24:42 -08:00
2026-02-26 10:45:49 +01:00
2026-01-05 16:43:34 +01:00
2026-02-27 22:00:08 +01:00
2025-11-14 13:10:38 +01:00
2026-02-27 22:00:11 +01:00
2026-02-21 20:03:00 -08:00
2026-02-03 08:21:26 -08:00
2026-02-21 20:03:00 -08:00
2025-11-11 10:01:32 +01:00
2026-02-10 11:39:30 +01:00
2025-11-04 08:30:50 +01:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-23 11:19:19 +01:00
2026-02-21 17:09:51 -08:00
2025-11-12 10:00:13 -08:00
2026-02-21 17:09:51 -08:00
2026-01-05 16:43:33 +01:00
2025-11-19 18:06:50 +01:00
2025-06-13 08:47:20 +02:00
2025-09-17 16:25:41 +02:00
2026-02-21 17:09:51 -08:00
2025-07-01 15:02:03 +02:00
2026-01-22 11:11:17 +01:00
2026-02-12 19:17:44 -08:00
2026-03-26 09:32:19 +01:00
2025-10-29 10:29:54 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-26 19:07:13 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 01:02:28 -08:00
2026-02-22 08:26:33 -08:00
2025-11-11 10:01:32 +01:00
2025-09-29 11:20:29 -07:00
2026-02-21 17:09:51 -08:00
2026-02-12 12:13:01 -08:00
2026-02-21 17:09:51 -08:00
2025-07-31 11:28:03 -04:00
2026-02-08 00:13:35 -08:00
2026-02-08 00:13:34 -08:00
2026-03-05 07:27:48 -10:00
2026-03-25 05:51:02 -10:00