Skip to content

Commit 9087c6f

Browse files
edumazetborkmann
authored andcommitted
bpf: Call maybe_wait_bpf_programs() only once from generic_map_delete_batch()
As stated in the comment found in maybe_wait_bpf_programs(), the synchronize_rcu() barrier is only needed before returning to userspace, not after each deletion in the batch. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Stanislav Fomichev <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 086d490 commit 9087c6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/bpf/syscall.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,6 @@ int generic_map_delete_batch(struct bpf_map *map,
13521352
err = map->ops->map_delete_elem(map, key);
13531353
rcu_read_unlock();
13541354
bpf_enable_instrumentation();
1355-
maybe_wait_bpf_programs(map);
13561355
if (err)
13571356
break;
13581357
cond_resched();
@@ -1361,6 +1360,8 @@ int generic_map_delete_batch(struct bpf_map *map,
13611360
err = -EFAULT;
13621361

13631362
kvfree(key);
1363+
1364+
maybe_wait_bpf_programs(map);
13641365
return err;
13651366
}
13661367

0 commit comments

Comments
 (0)