Lockless multi-core high-throughput buffering scheme for kernel tracing

Studying execution of concurrent real-time online systems, to identify far-reaching and hard to reproduce latency and performance problems, requires a mechanism able to cope with voluminous information extracted from execution traces. Furthermore, the workload must not be disturbed by tracing, thereby causing the problematic behavior to become unreproducible. In order to satisfy this low-disturbance constraint, we created the LTTng kernel tracer. It is designed to enable safe and race-free attachment of probes virtually anywhere in the operating system, including sites executed in non-maskable interrupt context. In addition to being reentrant with respect to all kernel execution contexts, LTTng offers good performance and scalability, mainly due to its use of per-CPU data structures, local atomic operations as main buffer synchronization primitive, and RCU (Read-Copy Update) mechanism to control tracing. Given that kernel infrastructure used by the tracer could lead to infinite recursion if traced, and typically requires non-atomic synchronization, this paper proposes an asynchronous mechanism to inform the kernel that a buffer is ready to read. This ensures that tracing sites do not require any kernel primitive, and therefore protects from infinite recursion. This paper presents the core of LTTng's buffering algorithms and measures its performance.

[1]  P ? ? ? ? ? ? ? % ? ? ? ? , 1991 .

[2]  Bryan Cantrill,et al.  Dynamic Instrumentation of Production Systems , 2004, USENIX Annual Technical Conference, General Track.

[3]  Mathieu Desnoyers,et al.  Synchronization for fast and reentrant operating system kernel tracing , 2010 .

[4]  Dilma Da Silva,et al.  K42: building a complete operating system , 2006, EuroSys.

[5]  Robert Wisniewski relayfs : An Efficient Unified Approach for Transmitting Data from Kernel to User Space , 2003 .

[6]  R.W. Wisniewski,et al.  Efficient, Unified, and Scalable Performance Monitoring for Multiprocessor Operating Systems , 2003, ACM/IEEE SC 2003 Conference (SC'03).

[7]  Ananth Mavinakayanahalli,et al.  Probing the Guts of Kprobes , 2010 .

[8]  M. Desnoyers,et al.  The LTTng tracer: A low impact performance and behavior monitor for GNU/Linux , 2006 .

[9]  Brad Chen,et al.  Locating System Problems Using Dynamic Instrumentation , 2010 .

[10]  DA SILVA , 2013 .

[11]  Maged M. Michael,et al.  Experiences Understanding Performance in a Commercial Scale-Out Environment , 2007, Euro-Par.

[12]  Jonathan Walpole,et al.  User-Level Implementations of Read-Copy Update , 2012, IEEE Transactions on Parallel and Distributed Systems.

[13]  M. Desnoyers Low-Impact Operating System Tracing , 2009 .

[14]  Mathieu Desnoyers,et al.  Linux Kernel Debugging on Google-sized clusters , 2007 .

[15]  Jonathan Walpole,et al.  Exploiting deferred destruction: an analysis of read-copy-update techniques in operating system kernels , 2004 .