diff options
| author | Hou Tao <houtao1@huawei.com> | 2025-01-08 09:07:23 +0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-01-08 18:06:36 -0800 |
| commit | 1d2dbe7120e89090ed4f6be03d6fbadfbfff59bf (patch) | |
| tree | ac65a76d06420be8daf9a6488e3a74103ceb26b1 /kernel/bpf/syscall.c | |
| parent | bpf: Disable migration before calling ops->map_free() (diff) | |
| download | linux-1d2dbe7120e89090ed4f6be03d6fbadfbfff59bf.tar.gz linux-1d2dbe7120e89090ed4f6be03d6fbadfbfff59bf.zip | |
bpf: Remove migrate_{disable|enable} in bpf_obj_free_fields()
The callers of bpf_obj_free_fields() have already guaranteed that the
migration is disabled, therefore, there is no need to invoke
migrate_{disable,enable} pair in bpf_obj_free_fields()'s underly
implementation.
This patch removes unnecessary migrate_{disable|enable} pairs from
bpf_obj_free_fields() and its callees: bpf_list_head_free() and
bpf_rb_root_free().
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250108010728.207536-12-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/syscall.c')
| -rw-r--r-- | kernel/bpf/syscall.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 5d2420492946..0daf098e3207 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -796,11 +796,9 @@ void bpf_obj_free_fields(const struct btf_record *rec, void *obj) if (!btf_is_kernel(field->kptr.btf)) { pointee_struct_meta = btf_find_struct_meta(field->kptr.btf, field->kptr.btf_id); - migrate_disable(); __bpf_obj_drop_impl(xchgd_field, pointee_struct_meta ? pointee_struct_meta->record : NULL, fields[i].type == BPF_KPTR_PERCPU); - migrate_enable(); } else { field->kptr.dtor(xchgd_field); } |
