-
Notifications
You must be signed in to change notification settings - Fork 93
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 #2373
bpf_prog_pack allocator #2373
Conversation
Master branch: 640a171 Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=603086
conflict:
|
Master branch: 640a171 |
ec46ba4
to
ba8dd2d
Compare
Master branch: 1372d34 |
ba8dd2d
to
0fd5f6d
Compare
Master branch: 70bc793 |
0fd5f6d
to
1d29021
Compare
Master branch: e59618f |
1d29021
to
9a47d07
Compare
Master branch: 44bab87 |
9a47d07
to
7a10068
Compare
Master branch: eff14fc |
7a10068
to
332f71a
Compare
Master branch: e4a3d6a |
332f71a
to
33a4928
Compare
Master branch: c25af83 |
33a4928
to
b9d87b6
Compare
Master branch: 8134b50 |
b9d87b6
to
dcea366
Compare
Master branch: 242db6c |
dcea366
to
689dc50
Compare
Master branch: 81b8e12 |
689dc50
to
ed7619e
Compare
Master branch: 775a64e |
ed7619e
to
c011917
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>
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 <songliubraving@fb.com>
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. 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>
Master branch: 775a64e |
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_jit(). Similarly, jit_fill_hole() is updated to fill the hole with 0xcc using text_poke_jit(). Signed-off-by: Song Liu <songliubraving@fb.com>
c011917
to
bec8648
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=603086 expired. Closing PR. |
Pull request for series with
subject: bpf_prog_pack allocator
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=603086