]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Remove migrate_{disable|enable} from bpf_cgrp_storage_lock helpers
authorHou Tao <houtao1@huawei.com>
Wed, 8 Jan 2025 01:07:16 +0000 (09:07 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 9 Jan 2025 02:06:36 +0000 (18:06 -0800)
commit25dc65f75b08281a42823673d1751c82618ce7a3
treefd597769329365f90106d706bf427ed922e71f90
parent53f2ba0b1cc087a597b43e63d35f355e9348bd61
bpf: Remove migrate_{disable|enable} from bpf_cgrp_storage_lock helpers

Three callers of bpf_cgrp_storage_lock() are ->map_lookup_elem,
->map_update_elem, ->map_delete_elem from bpf syscall. BPF syscall for
these three operations of cgrp storage has already disabled migration.

Two call sites of bpf_cgrp_storage_trylock() are bpf_cgrp_storage_get(),
and bpf_cgrp_storage_delete() helpers. The running contexts of these
helpers have already disabled migration.

Therefore, it is safe to remove migrate_disable() for these callers.
However, bpf_cgrp_storage_free() also invokes bpf_cgrp_storage_lock()
and its running context doesn't disable migration. Therefore, also add
the missed migrate_{disabled|enable} in bpf_cgrp_storage_free().

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250108010728.207536-5-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/bpf_cgrp_storage.c