aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2024-02-29 15:23:12 -0800
committerMartin KaFai Lau <martin.lau@kernel.org>2024-03-04 14:09:24 -0800
commit8f50d5c423551bfa259af792647a2f4799780ac5 (patch)
treec3e977ac6a70cf40b315f9d84c42ad51b5d35799 /mm
parent01031fd473059bf69bb6edc6d51d4bd58ad92e50 (diff)
parent93bc28d859e57f1a654d3b63600d14c85c5630a4 (diff)
downloadlinux-8f50d5c423551bfa259af792647a2f4799780ac5.tar.gz
Merge branch 'Allow struct_ops maps with a large number of programs'
Kui-Feng Lee says: ==================== The BPF struct_ops previously only allowed for one page to be used for the trampolines of all links in a map. However, we have recently run out of space due to the large number of BPF program links. By allocating additional pages when we exhaust an existing page, we can accommodate more links in a single map. The variable st_map->image has been changed to st_map->image_pages, and its type has been changed to an array of pointers to buffers of PAGE_SIZE. Additional pages are allocated when all existing pages are exhausted. The test case loads a struct_ops maps having 40 programs. Their trampolines takes about 6.6k+ bytes over 1.5 pages on x86. --- Major differences from v3: - Refactor buffer allocations to bpf_struct_ops_tramp_buf_alloc() and bpf_struct_ops_tramp_buf_free(). Major differences from v2: - Move image buffer allocation to bpf_struct_ops_prepare_trampoline(). Major differences from v1: - Always free pages if failing to update. - Allocate 8 pages at most. v3: https://lore.kernel.org/all/20240224030302.1500343-1-thinker.li@gmail.com/ v2: https://lore.kernel.org/all/20240221225911.757861-1-thinker.li@gmail.com/ v1: https://lore.kernel.org/all/20240216182828.201727-1-thinker.li@gmail.com/ ==================== Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions