OSDN Git Service

Merge branch 'libbpf: capability for resizing datasec maps'
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 24 May 2023 18:11:34 +0000 (11:11 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 24 May 2023 18:45:00 +0000 (11:45 -0700)
JP Kobryn says:

====================
Due to the way the datasec maps like bss, data, rodata are memory
mapped, they cannot be resized with bpf_map__set_value_size() like
non-datasec maps can. This series offers a way to allow the resizing of
datasec maps, by having the mapped regions resized as needed and also
adjusting associated BTF info if possible.

The thought behind this is to allow for use cases where a given datasec
needs to scale to for example the number of CPU's present. A bpf program
can have a global array in a data section with an initial length and
before loading the bpf program, the array length could be extended to
match the CPU count. The selftests included in this series perform this
scaling to an arbitrary value to demonstrate how it can work.
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

Trivial merge