Skip to content

Commit 83f4031

Browse files
vnagarnaikrostedt
authored andcommitted
ring-buffer: Make removal of ring buffer pages atomic
This patch adds the capability to remove pages from a ring buffer without destroying any existing data in it. This is done by removing the pages after the tail page. This makes sure that first all the empty pages in the ring buffer are removed. If the head page is one in the list of pages to be removed, then the page after the removed ones is made the head page. This removes the oldest data from the ring buffer and keeps the latest data around to be read. To do this in a non-racey manner, tracing is stopped for a very short time while the pages to be removed are identified and unlinked from the ring buffer. The pages are freed after the tracing is restarted to minimize the time needed to stop tracing. The context in which the pages from the per-cpu ring buffer are removed runs on the respective CPU. This minimizes the events not traced to only NMI trace contexts. Link: http://lkml.kernel.org/r/[email protected] Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Laurent Chavey <[email protected]> Cc: Justin Teravest <[email protected]> Cc: David Sharp <[email protected]> Signed-off-by: Vaibhav Nagarnaik <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 6edb2a8 commit 83f4031

File tree

2 files changed

+209
-76
lines changed

2 files changed

+209
-76
lines changed

0 commit comments

Comments
 (0)