Skip to content

Commit 44bf461

Browse files
alectric-tranakryiko
authored andcommitted
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
1 parent 590699d commit 44bf461

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Documentation/bpf/map_array.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ of constant size. The size of the array is defined in ``max_entries`` at
1515
creation time. All array elements are pre-allocated and zero initialized when
1616
created. ``BPF_MAP_TYPE_PERCPU_ARRAY`` uses a different memory region for each
1717
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.
2021

2122
Since kernel 5.5, memory mapping may be enabled for ``BPF_MAP_TYPE_ARRAY`` by
2223
setting the flag ``BPF_F_MMAPABLE``. The map definition is page-aligned and

0 commit comments

Comments
 (0)