diff options
author | Hou Tao <houtao1@huawei.com> | 2025-01-08 09:07:19 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2025-01-08 18:06:36 -0800 |
commit | 7d1032d1e3031ef38d1a360380d755f75cb639b8 (patch) | |
tree | 45f58fd1bef89b1c4a2fdfbc182d0c567fbe2cfc /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | e319cdc8956645b6e29a3809924647953500b7e1 (diff) |
bpf: Disable migration when destroying sock storage
When destroying sock storage, it invokes bpf_local_storage_destroy() to
remove all storage elements saved in the sock storage. The destroy
procedure will call bpf_selem_free() to free the element, and
bpf_selem_free() calls bpf_obj_free_fields() to free the special fields
in map value (e.g., kptr). Since kptrs may be allocated from bpf memory
allocator, migrate_{disable|enable} pairs are necessary for the freeing
of these kptrs.
To simplify reasoning about when migrate_disable() is needed for the
freeing of these dynamically-allocated kptrs, let the caller to
guarantee migration is disabled before invoking bpf_obj_free_fields().
Therefore, the patch adds migrate_{disable|enable} pair in
bpf_sock_storage_free(). The migrate_{disable|enable} pairs in the
underlying implementation of bpf_obj_free_fields() will be removed by
The following patch.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250108010728.207536-8-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions