Skip to content

Commit 2269b32

Browse files
Hou TaoAlexei Starovoitov
authored andcommitted
bpf: Remove migrate_{disable|enable} from bpf_selem_alloc()
bpf_selem_alloc() has two callers: (1) bpf_sk_storage_clone_elem() bpf_sk_storage_clone() has already disabled migration before invoking bpf_sk_storage_clone_elem(). (2) bpf_local_storage_update() Its callers include: cgrp/task/inode/sock storage ->map_update_elem() callbacks and bpf_{cgrp|task|inode|sk}_storage_get() helpers. These running contexts have already disabled migration Therefore, there is no need to add extra migrate_{disable|enable} pair in bpf_selem_alloc(). Signed-off-by: Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/r/20250108010728.207536-14-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 6a52b96 commit 2269b32

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

kernel/bpf/bpf_local_storage.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ bpf_selem_alloc(struct bpf_local_storage_map *smap, void *owner,
8181
return NULL;
8282

8383
if (smap->bpf_ma) {
84-
migrate_disable();
8584
selem = bpf_mem_cache_alloc_flags(&smap->selem_ma, gfp_flags);
86-
migrate_enable();
8785
if (selem)
8886
/* Keep the original bpf_map_kzalloc behavior
8987
* before started using the bpf_mem_cache_alloc.

0 commit comments

Comments
 (0)