]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add schedule points in batch ops
authorEric Dumazet <edumazet@google.com>
Thu, 17 Feb 2022 18:19:02 +0000 (10:19 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 17 Feb 2022 18:48:26 +0000 (10:48 -0800)
commit22f7ba8e30502e74c69006256aedbb1834ecb81b
treea9c3a90aad2989c2c3067a900fb43b03841092f5
parent8ed079df20044e3787de1825d2b9ce0a1bc0b3d6
bpf: Add schedule points in batch ops

syzbot reported various soft lockups caused by bpf batch operations.

 INFO: task kworker/1:1:27 blocked for more than 140 seconds.
 INFO: task hung in rcu_barrier

Nothing prevents batch ops to process huge amount of data,
we need to add schedule points in them.

Note that maybe_wait_bpf_programs(map) calls from
generic_map_delete_batch() can be factorized by moving
the call after the loop.

This will be done later in -next tree once we get this fix merged,
unless there is strong opinion doing this optimization sooner.

Fixes: 352625a1b08d ("bpf: Add generic support for update and delete batch ops")
Fixes: 694a8e604cdc ("bpf: Add generic support for lookup batch op")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Brian Vazquez <brianvv@google.com>
Link: https://lore.kernel.org/bpf/20220217181902.808742-1-eric.dumazet@gmail.com
kernel/bpf/syscall.c