diff options
author | Yonghong Song <yonghong.song@linux.dev> | 2024-01-04 19:57:44 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-01-04 21:18:14 +0300 |
commit | 9ddf872b47e3ac8f27dbfc4a4737a976c7588de6 (patch) | |
tree | 3cbc51ba9cbb22d6bcb1deb127146fadf31c260e /tools/testing/selftests | |
parent | c040e902b07e946ff73e81d4abb4347d2c0b6044 (diff) | |
download | linux-9ddf872b47e3ac8f27dbfc4a4737a976c7588de6.tar.xz |
bpf: Remove unnecessary cpu == 0 check in memalloc
After merging the patch set [1] to reduce memory usage
for bpf_global_percpu_ma, Alexei found a redundant check (cpu == 0)
in function bpf_mem_alloc_percpu_unit_init() ([2]).
Indeed, the check is unnecessary since c->unit_size will
be all NULL or all non-NULL for all cpus before
for_each_possible_cpu() loop.
Removing the check makes code less confusing.
[1] https://lore.kernel.org/all/20231222031729.1287957-1-yonghong.song@linux.dev/
[2] https://lore.kernel.org/all/20231222031745.1289082-1-yonghong.song@linux.dev/
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20240104165744.702239-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests')
0 files changed, 0 insertions, 0 deletions