RESIZE_ARRAY(9)
π RESIZE_ARRAY(9) β like, the Kernel API Manual page you actually wanna read
okay so picture this: you're deep in the Kernel API Manual, section 9, and you've got a BPF array that needs to grow. Bestie, this macro is your girl. Let's get into it β¨
π¦ NAME
RESIZE_ARRAY β the convenience macro for resizing a BPF array. That's it, that's the whole vibe. No cap.
π SYNOPSIS
RESIZE_ARRAY (__skel , elfsec , arr , n );
β¨ ARGUMENTS
__skelβ the skeleton that's holding your array. the whole container, the main character π«Άelfsecβ the data section of the BPF program where the array lives. you gotta tell it where πarrβ the name of the array. literally just the name, bestie πnβ the desired array element count. how many you want. the number. the goal. β
π₯ DESCRIPTION
Okay so for BPF arrays declared with RESIZABLE_ARRAY, this macro does two things, and honestly? both ate.
Operation one: it resizes the map that corresponds to the custom data section containing the target array. And as a little side effect β lowkey iconic β the BTF info for the array gets adjusted so that the array length is sized to cover the new data section size. slay π
Operation two: it reassigns the skeleton pointer for that custom data section so it points at the newly memory mapped region. boom. new region, new pointer, new you. β¨
ngl, that's the whole thing β two operations, done. no weird edge cases listed here, so don't go inventing any π
π SEE ALSO
- the Kernel file
./tools/sched_ext/include/scx/common.hβ go read it, iykyk π
and that's the page!! π¦ big kisses to ./tools/sched_ext/include/scx for the source, October 2026 for the date, and the Kernel API Manual for hosting. mwah π periodt.
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms