ring-buffer: Set new size of the ring buffer sub page
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Tue, 19 Dec 2023 18:54:18 +0000 (13:54 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 20 Dec 2023 12:54:56 +0000 (07:54 -0500)
commitf9b94daa542a8d2532f0930f01cd9aec2d19621b
tree27329ad5e15c277aff46f7685102717c3a25e4ff
parent2808e31ec12e5fbe2ae25acc027fcdc67b1fb7f0
ring-buffer: Set new size of the ring buffer sub page

There are two approaches when changing the size of the ring buffer
sub page:
 1. Destroying all pages and allocating new pages with the new size.
 2. Allocating new pages, copying the content of the old pages before
    destroying them.
The first approach is easier, it is selected in the proposed
implementation. Changing the ring buffer sub page size is supposed to
not happen frequently. Usually, that size should be set only once,
when the buffer is not in use yet and is supposed to be empty.

Link: https://lore.kernel.org/linux-trace-devel/20211213094825.61876-5-tz.stoyanov@gmail.com
Link: https://lore.kernel.org/linux-trace-kernel/20231219185628.588995543@goodmis.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vincent Donnefort <vdonnefort@google.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c