bpfLoader: automatically bump ringbuffer size up to page size
A 4kB BPF_MAP_TYPE_RINGBUF does not work on 16kB page size kernel,
as an eBPF ring buffer size *must* be a multiple of the page size.
However, it is inefficient to force a 16kB RINGBUF on kernels
with only a 4kB page size.
It wastes 12kB of mlock'ed memory per ring buffer,
which isn't much, but - as we add more ringbuffers - it'll add up...
The userspace ring buffer code doesn't actually mind the
automatic increase in size, as it retrieves the actual
size from the map fd (ie. from the kernel) during init
and thus adjusts automatically.
Test: TreeHugger
Bug: 279819914
Signed-off-by: Maciej Żenczykowski <maze@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:8a117a374bd71dc21a42f5a4bdbe3324ca5357d8)
Merged-In: I9fcb1f9dc2e86038a7f1a486f4efbc28dba38ca0
Change-Id: I9fcb1f9dc2e86038a7f1a486f4efbc28dba38ca0
1 file changed