ring-buffer: Align meta-page to sub-buffers for improved TLB usage
authorVincent Donnefort <vdonnefort@google.com>
Fri, 28 Jun 2024 10:46:11 +0000 (11:46 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 26 Aug 2024 17:42:23 +0000 (13:42 -0400)
commiteb2dcde9f970ed8d3669444d47c8524b4bdf7d32
treefce2721f068acd2461f8d315c4c2406383348a56
parentd0f2d6e9512ecf4306c4432761f04bd35cf9e3a6
ring-buffer: Align meta-page to sub-buffers for improved TLB usage

Previously, the mapped ring-buffer layout caused misalignment between
the meta-page and sub-buffers when the sub-buffer size was not a
multiple of PAGE_SIZE. This prevented hardware with larger TLB entries
from utilizing them effectively.

Add a padding with the zero-page between the meta-page and sub-buffers.
Also update the ring-buffer map_test to verify that padding.

Link: https://lore.kernel.org/20240628104611.1443542-1-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c
tools/testing/selftests/ring-buffer/map_test.c