summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Tran <alex.t.tran@gmail.com>2025-11-14 22:35:31 -0800
committerAndrii Nakryiko <andrii@kernel.org>2025-11-25 14:32:00 -0800
commit44bf4611827b7477db188ec932b827e1fabd3ee1 (patch)
tree43e6839a1e5d303c51f7568a6548cc5616cb4c2f
parent590699d85823f38b74d52a0811ef22ebb61afddc (diff)
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
-rw-r--r--Documentation/bpf/map_array.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/bpf/map_array.rst b/Documentation/bpf/map_array.rst
index f2f51a53e8ae..fa56ff75190c 100644
--- a/Documentation/bpf/map_array.rst
+++ b/Documentation/bpf/map_array.rst
@@ -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