diff options
author | Yonghong Song <yonghong.song@linux.dev> | 2023-12-22 06:18:01 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-01-04 08:08:26 +0300 |
commit | 5c1a37653260ed5d9c8b26fb7fe7b99629612982 (patch) | |
tree | 9cd3e4d1531ee6e46147d65ebc3dce1259409b15 /kernel/audit.c | |
parent | 0e2ba9f96f9b82893ba19170ae48d46003f8ef44 (diff) | |
download | linux-5c1a37653260ed5d9c8b26fb7fe7b99629612982.tar.xz |
bpf: Limit up to 512 bytes for bpf_global_percpu_ma allocation
For percpu data structure allocation with bpf_global_percpu_ma,
the maximum data size is 4K. But for a system with large
number of cpus, bigger data size (e.g., 2K, 4K) might consume
a lot of memory. For example, the percpu memory consumption
with unit size 2K and 1024 cpus will be 2K * 1K * 1k = 2GB
memory.
We should discourage such usage. Let us limit the maximum data
size to be 512 for bpf_global_percpu_ma allocation.
Acked-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231222031801.1290841-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/audit.c')
0 files changed, 0 insertions, 0 deletions