Scalable Buffer Control for Tracing Frameworks

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional kernel tracing frameworks face performance bottlenecks due to serialization of access to a global buffer by multiple threads, leading to potential blocking and reduced system efficiency when recording tracing events.

Innovation Solution

Segmenting a global buffer into CPU buffers, which are further divided into probe buffers with indices, allowing threads to store tracing events using a hash function to access specific indices within these buffers, thereby reducing contention and enabling simultaneous access by multiple threads.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a global buffer is used for storing tracing events, then all threads can access a shared resource, but access becomes serialized and threads are blocked

Engineering Contradiction:
Improveshared buffer accessVSAvoidthread execution efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The global buffer is segmented into multiple per-CPU buffers, allowing threads on different CPUs to access different buffers simultaneously. This eliminates the serialization bottleneck by distributing the shared resource into independent segments that can be accessed in parallel.

Inventive Principle:
Principle #1Segmentation

2Reliability

If a lock is obtained for the global buffer, then thread safety is ensured, but other threads are prevented from accessing the buffer during the lock period

Engineering Contradiction:
Improvebuffer access safetyVSAvoidthread blocking time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

By dividing the global buffer into per-CPU buffers, each buffer can be independently accessed without requiring global locks. Threads only need to ensure safety within their own CPU's buffer, dramatically reducing lock contention and blocking time while maintaining thread safety.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Thread safety is enforced locally within each per-CPU buffer rather than globally across the entire buffer system. This allows different CPUs to have independent safety mechanisms operating in parallel, eliminating the need for global locking and reducing time loss.

Inventive Principle:
Principle #3Local quality

3Device complexity

If tracing event data is recorded sequentially into the global buffer, then buffer management is simple, but system scalability is limited

Engineering Contradiction:
Improvebuffer management complexityVSAvoidsystem scalability
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The buffer system is segmented into per-CPU buffers with their own independent management structures. This allows the system to scale to multiple CPUs without a single point of contention, as each CPU manages its own buffer independently while maintaining overall system coherence.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS7370171B1Scalable buffer control for a tracing framework
Publication Date: 2008.05.06 ORACLE AMERICAN INC
  • US7370171B1 patent drawing
  • US7370171B1 patent drawing
  • US7370171B1 patent drawing

AI summary

A method for storing a tracing event including encountering a tracing probe, selecting a probe buffer corresponding to the tracing probe, obtaining a buffer within the probe buffer using a thread identifier corresponding to a thread that encountered the tracing probe, and storing the tracing event in the buffer.