Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <alex.t.tran@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20251115063531.2302903-1-alex.t.tran@gmail.com

authored by

Alex Tran and committed by
Andrii Nakryiko
44bf4611 590699d8

+3 -2
+3 -2
Documentation/bpf/map_array.rst
··· 15 15 creation time. All array elements are pre-allocated and zero initialized when 16 16 created. ``BPF_MAP_TYPE_PERCPU_ARRAY`` uses a different memory region for each 17 17 CPU whereas ``BPF_MAP_TYPE_ARRAY`` uses the same memory region. The value 18 - stored can be of any size, however, all array elements are aligned to 8 19 - bytes. 18 + stored can be of any size for ``BPF_MAP_TYPE_ARRAY`` and not more than 19 + ``PCPU_MIN_UNIT_SIZE`` (32 kB) for ``BPF_MAP_TYPE_PERCPU_ARRAY``. All 20 + array elements are aligned to 8 bytes. 20 21 21 22 Since kernel 5.5, memory mapping may be enabled for ``BPF_MAP_TYPE_ARRAY`` by 22 23 setting the flag ``BPF_F_MMAPABLE``. The map definition is page-aligned and