-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf_prog_pack allocator #2436
bpf_prog_pack allocator #2436
Conversation
Master branch: 4e95074 |
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=606724 expired. Closing PR. |
Master branch: 4e95074 |
825bdb4
to
bba46b3
Compare
Master branch: 1058b6a |
bba46b3
to
3033f5c
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=607031 expired. Closing PR. |
Master branch: 820e6e2 |
3033f5c
to
0b67a50
Compare
This enables module_alloc() to allocate huge page for 2MB+ requests. To check the difference of this change, we need enable config CONFIG_PTDUMP_DEBUGFS, and call module_alloc(2MB). Before the change, /sys/kernel/debug/page_tables/kernel shows pte for this map. With the change, /sys/kernel/debug/page_tables/ show pmd for thie map. Signed-off-by: Song Liu <songliubraving@fb.com>
This enables sub-page memory charge and allocation. Signed-off-by: Song Liu <songliubraving@fb.com>
Master branch: a9921ce |
This is necessary to charge sub page memory for the BPF program. Signed-off-by: Song Liu <songliubraving@fb.com>
With sub page allocation, we cannot simply use bpf_func & PAGE_MASK to find the bpf_binary_header. Add a pointer to struct bpf_prog to avoid this logic. Use this point for x86_64. If the pointer is not set by the jit engine, fall back to original logic. Signed-off-by: Song Liu <song@kernel.org>
This will be used by BPF jit compiler to dump JITed binary to a RX huge page, and thus allow multiple BPF programs sharing the a huge (2MB) page. Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Song Liu <song@kernel.org>
Most BPF programs are small, but they consume a page each. For systems with busy traffic and many BPF programs, this could add significant pressure to instruction TLB. Introduce bpf_prog_pack allocator to pack multiple BPF programs in a huge page. The memory is then allocated in 64 byte chunks. Memory allocated by bpf_prog_pack allocator is RO protected after initial allocation. To write to it, the user (jit engine) need to use text poke API. Signed-off-by: Song Liu <songliubraving@fb.com>
Use bpf_prog_pack allocator in x86_64 jit. The program header from bpf_prog_pack is read only during the jit process. Therefore, the binary is first written to a temporary buffer, and later copied to final location with text_poke_copy(). Similarly, jit_fill_hole() is updated to fill the hole with 0xcc using text_poke_copy(). Signed-off-by: Song Liu <songliubraving@fb.com>
0b67a50
to
ab68490
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=607370 expired. Closing PR. |
Pull request for series with
subject: bpf_prog_pack allocator
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=606724