Skip to content

Comments

btf: mmap vmlinux if possible#1812

Merged
lmb merged 2 commits intocilium:mainfrom
lmb:btf-mmap-vmlinux
Jul 30, 2025
Merged

btf: mmap vmlinux if possible#1812
lmb merged 2 commits intocilium:mainfrom
lmb:btf-mmap-vmlinux

Conversation

@lmb
Copy link
Contributor

@lmb lmb commented Jun 24, 2025

See commit messages. Merge once 6.16 is released.

@lmb lmb force-pushed the btf-mmap-vmlinux branch from 382bd1a to a4390f4 Compare June 24, 2025 11:36
@lmb lmb force-pushed the btf-mmap-vmlinux branch 2 times, most recently from 01cae9e to c028138 Compare June 26, 2025 10:57
@lmb lmb force-pushed the btf-mmap-vmlinux branch from c028138 to f3f37f9 Compare July 30, 2025 10:55
lmb added 2 commits July 30, 2025 13:10
Parsing BTF still relies on io.Reader(At) in places, which makes it
awkward to parse from a plain byte slice. Rework the internal
plumbing to use []byte.

This also deductes the endianness of a BTF blob from its header,
which allows us to get rid of guessBTFByteOrder.

Signed-off-by: Lorenz Bauer <[email protected]>
The kernel recently gained the ability to mmap vmlinux BTF, which
allows us to not allocate a couple megabytes of heap memory.

See torvalds/linux@a539e2a

Signed-off-by: Lorenz Bauer <[email protected]>
@lmb lmb force-pushed the btf-mmap-vmlinux branch from f3f37f9 to e4c8883 Compare July 30, 2025 12:34
@lmb lmb marked this pull request as ready for review July 30, 2025 12:35
@lmb lmb requested review from a team and dylandreimerink as code owners July 30, 2025 12:35
@lmb lmb merged commit 59d5f32 into cilium:main Jul 30, 2025
18 checks passed
@lmb lmb deleted the btf-mmap-vmlinux branch July 30, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants