diff options
author | Hou Tao <houtao1@huawei.com> | 2025-01-08 09:07:20 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2025-01-08 18:06:36 -0800 |
commit | dfccfc47bde53f5df5bf42486d12a8a2ecdcea60 (patch) | |
tree | 6ca15ad45b449b76fb2712fb39ea09d77a244a3f /tools/perf/scripts/python | |
parent | 7d1032d1e3031ef38d1a360380d755f75cb639b8 (diff) |
bpf: Disable migration when cloning sock storage
bpf_sk_storage_clone() will call bpf_selem_free() to free the clone
element when the allocation of new sock storage fails. bpf_selem_free()
will call check_and_free_fields() to free the special fields in the
element. Since the allocated element is not visible to bpf syscall or
bpf program when bpf_local_storage_alloc() fails, these special fields
in the element must be all zero when invoking bpf_selem_free().
To be uniform with other callers of bpf_selem_free(), disabling
migration when cloning sock storage. Adding migrate_{disable|enable}
pair also benefits the potential switching from kzalloc to bpf memory
allocator for sock storage.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250108010728.207536-9-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions