Skip to content

Commit 4855a75

Browse files
Hou TaoAlexei Starovoitov
authored andcommitted
bpf: Remove migrate_{disable|enable} from bpf_local_storage_alloc()
These two callers of bpf_local_storage_alloc() are the same as bpf_selem_alloc(): bpf_sk_storage_clone() and bpf_local_storage_update(). The running contexts of these two callers have already disabled migration, therefore, there is no need to add extra migrate_{disable|enable} pair in bpf_local_storage_alloc(). Signed-off-by: Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/r/20250108010728.207536-15-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 2269b32 commit 4855a75

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

kernel/bpf/bpf_local_storage.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,15 +498,11 @@ int bpf_local_storage_alloc(void *owner,
498498
if (err)
499499
return err;
500500

501-
if (smap->bpf_ma) {
502-
migrate_disable();
501+
if (smap->bpf_ma)
503502
storage = bpf_mem_cache_alloc_flags(&smap->storage_ma, gfp_flags);
504-
migrate_enable();
505-
} else {
503+
else
506504
storage = bpf_map_kzalloc(&smap->map, sizeof(*storage),
507505
gfp_flags | __GFP_NOWARN);
508-
}
509-
510506
if (!storage) {
511507
err = -ENOMEM;
512508
goto uncharge;

0 commit comments

Comments
 (0)