Skip to content

Commit 6a52b96

Browse files
Hou TaoAlexei Starovoitov
authored andcommitted
bpf: Remove migrate_{disable,enable} in bpf_cpumask_release()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 1d2dbe7 commit 6a52b96

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/bpf/cpumask.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ __bpf_kfunc void bpf_cpumask_release(struct bpf_cpumask *cpumask)
9191
if (!refcount_dec_and_test(&cpumask->usage))
9292
return;
9393

94-
migrate_disable();
9594
bpf_mem_cache_free_rcu(&bpf_cpumask_ma, cpumask);
96-
migrate_enable();
9795
}
9896

9997
__bpf_kfunc void bpf_cpumask_release_dtor(void *cpumask)

0 commit comments

Comments
 (0)