Generic Ring Buffer Library

The Generic Ring Buffer patchset implements a generic ring buffer library in the Linux kernel. It provides a very efficient, yet flexible, API to both tracers and drivers to move large amounts of data within and outside of kernel-space.

It comes as a response to Linus mandate from the 2008 Kernel Summit. In May 2010, Steven Rostedt, author of the Ftrace ring buffer, came forward and asked me if I could handle this task, which results in this patchset. In addition to come up with a common ring buffer, this patchset takes into account the pressing industry need for a blazingly fast, and reliable, ring buffer. Tracing, as we know, is a very resource-hungry activity, which should be kept to small percentage of system's resources in order to be useful on heavy workloads, which are the most likely to reproduce bugs and performance problems.

It is derived from the LTTng ring buffer, heavily cleaned up and librarified to become a generic kernel ring buffer. The flexibility provided by this library does not come at the expense of performance, because each library client provides its own constant "configuration" structure passed along to each fast-path inline function, therefore letting the compiler perform code selection statically. The slow paths are shared amongst all clients, which allows overall code size savings as the number of library clients increases.

The Generic Ring Buffer Library is now embedded within LTTng modules 2.0.

Copyright © 2016, EfficiOS Inc.