]> Gentwo Git Trees - linux/.git/commit
bpf: Save memory alloction info in bpf_local_storage
authorAmery Hung <ameryhung@gmail.com>
Fri, 14 Nov 2025 20:13:25 +0000 (12:13 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Nov 2025 00:20:25 +0000 (16:20 -0800)
commit39a460c4253e4a437b6b372f462c0c043026784d
tree24ac06089892c697f4cbcdf82b72b0eac69942c0
parente76a33e1c7186526c2c133af73ea70da9275e1ba
bpf: Save memory alloction info in bpf_local_storage

Save the memory allocation method used for bpf_local_storage in the
struct explicitly so that we don't need to go through the hassle to
find out the info. When a later patch replaces BPF memory allocator
with kmalloc_noloc(), bpf_local_storage_free() will no longer need
smap->storage_ma to return the memory and completely remove the
dependency on smap in bpf_local_storage_free().

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Reviewed-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20251114201329.3275875-4-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf_local_storage.h
kernel/bpf/bpf_local_storage.c