docs: bpf: map_array: specify BPF_MAP_TYPE_PERCPU_ARRAY value size limit
Subsystems (2)
PATCH 1/1 docs: bpf: map_array: specify BPF_MAP_TYPE_PERCPU_ARRAY value size limit
Specify value size limit for BPF_MAP_TYPE_PERCPU_ARRAY which is PCPU_MIN_UNIT_SIZE (32 kb). In percpu allocator (mm: percpu), any request with a size greater than PCPU_MIN_UNIT_SIZE is rejected.
Signed-off-by Alex Tran <[email protected]>
--- Documentation/bpf/map_array.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/bpf/map_array.rst +3 -2
@@ -15,8 +15,9 @@ of constant size. The size of the array is defined in ``max_entries`` at creation time. All array elements are pre-allocated and zero initialized when created. ``BPF_MAP_TYPE_PERCPU_ARRAY`` uses a different memory region for each CPU whereas ``BPF_MAP_TYPE_ARRAY`` uses the same memory region. The value -stored can be of any size, however, all array elements are aligned to 8 -bytes. +stored can be of any size for ``BPF_MAP_TYPE_ARRAY`` and not more than +``PCPU_MIN_UNIT_SIZE`` (32 kB) for ``BPF_MAP_TYPE_PERCPU_ARRAY``. All +array elements are aligned to 8 bytes. Since kernel 5.5, memory mapping may be enabled for ``BPF_MAP_TYPE_ARRAY`` by setting the flag ``BPF_F_MMAPABLE``. The map definition is page-aligned and
Signature · 1 line
2.51.0
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 8 lines · On Fri, 14 Nov 2025 22:35:31 -0800 you wrote:
Specify value size limit for
BPF_MAP_TYPE_PERCPU_ARRAYwhich isPCPU_MIN_UNIT_SIZE(32 kb). In percpu allocator (mm: percpu), any request with a size greater thanPCPU_MIN_UNIT_SIZEis rejected.Signed-off-by Alex Tran <[email protected]>--- Documentation/bpf/map_array.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Here is the summary with links:
- [bpf-next,v1] docs: bpf: map_array: specify BPF_MAP_TYPE_PERCPU_ARRAY value size limit
https://git.kernel.org/bpf/bpf-next/c/44bf4611827b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html