]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpf: Remove migrate_{disable,enable} in bpf_cpumask_release()
authorHou Tao <houtao1@huawei.com>
Wed, 8 Jan 2025 01:07:24 +0000 (09:07 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 9 Jan 2025 02:06:37 +0000 (18:06 -0800)
When BPF program invokes bpf_cpumask_release(), the migration must have
been disabled. When bpf_cpumask_release_dtor() invokes
bpf_cpumask_release(), the caller bpf_obj_free_fields() also has
disabled migration, therefore, it is OK to remove the unnecessary
migrate_{disable|enable} pair in bpf_cpumask_release().

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

index 33c473d676a52f7e552a9e81d1b068b5f3b8f6e7..cfa1c18e3a48358fe303f30ff402146af2897a8e 100644 (file)
@@ -91,9 +91,7 @@ __bpf_kfunc void bpf_cpumask_release(struct bpf_cpumask *cpumask)
        if (!refcount_dec_and_test(&cpumask->usage))
                return;
 
-       migrate_disable();
        bpf_mem_cache_free_rcu(&bpf_cpumask_ma, cpumask);
-       migrate_enable();
 }
 
 __bpf_kfunc void bpf_cpumask_release_dtor(void *cpumask)