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)
commitfcf1fa29c8ea75bf104c35ce29b65ce2ba6a6a9d
tree3ac48fe645b27d5c1e8a42bf6881760d7f0d114c
parent3b22f98e5a05feee20699df0870dc5d47c9b61dd
parent08b0895675736c49f7b172eac7d5c042fc71c3ec
Merge branch 'libbpf: capability for resizing datasec maps'

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>