bpf: Remove unnecessary wait from bpf_map_copy_value()
authorHou Tao <houtao1@huawei.com>
Fri, 8 Dec 2023 10:23:49 +0000 (18:23 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 10 Dec 2023 02:12:33 +0000 (18:12 -0800)
Both map_lookup_elem() and generic_map_lookup_batch() use
bpf_map_copy_value() to lookup and copy the value, and there is no
update operation in bpf_map_copy_value(), so just remove the invocation
of maybe_wait_bpf_programs() from it.

Fixes: 15c14a3dca42 ("bpf: Add bpf_map_{value_size, update_value, map_copy_value} functions")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231208102355.2628918-2-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c

index aff045e..9ad3f52 100644 (file)
@@ -264,7 +264,6 @@ static int bpf_map_copy_value(struct bpf_map *map, void *key, void *value,
        }
 
        bpf_enable_instrumentation();
-       maybe_wait_bpf_programs(map);
 
        return err;
 }