Principled Performance Tunability in Operating System Kernels

Zhongjie Chen, Wentao Zhang, Yulong Tang, Ran Shu, Fengyuan Ren, Tianyin Xu, Jing LiuarXiv 2025 · DOI

Introduction

Modern operating system kernels are replete with "performance constants" (perf-consts)—hardcoded values that dictate critical system behaviors such as I/O batch sizes, interrupt thresholds, and cache reclamation limits. These values are typically selected by developers based on specific hardware or benchmarks available at the time of development. However, as hardware evolves and workloads shift, these static constants often become performance bottlenecks.

Traditionally, adjusting these constants requires either a full kernel recompilation and reboot—which is disruptive for high-availability systems—or standard live patching. Live patching, while avoiding reboots, often operates at the function level, can take minutes to apply, and lacks "side-effect safety," failing to guarantee that the influence of an old constant has fully dissipated before a new one takes effect. KernelX addresses this gap by enabling safe, millisecond-scale tuning of these constants in a running Linux kernel.

System Architecture and Methods

KernelX introduces a novel mechanism called Scoped Indirect Execution (SIE) to manage the transition between hardcoded constants and dynamic policies. The system operates in two distinct phases: offline analysis and online tuning.

Offline Analysis

During the offline phase, KernelX uses symbolic execution and binary differencing to identify two critical regions for any given constant:

  • Critical Span (CS): The specific sequence of instructions where the constant is loaded into the processor's registers or memory.
  • Safety Span (SS): The broader execution context where the side effects of that constant might still be active.

Online Tuning (The X-tune)

Once these spans are identified, developers can write tuning policies, known as X-tunes, using eBPF. KernelX utilizes Kprobes to intercept execution at the Critical Span. Instead of executing the original hardcoded instruction, the system redirects execution to a JIT-compiled indirection that applies a new value based on the eBPF policy.

The KernelX workflow: from offline analysis of kernel source/binary to online tuning via eBPF-based X-tunes in user and kernel space.

To ensure safety, KernelX monitors the Safety Span. It only activates a new value when it can verify that no thread is currently executing within the old value's safety scope, thereby preventing inconsistent system states.

Evaluation and Key Results

The researchers evaluated KernelX on 140 different performance constants across major Linux subsystems, including storage, CPU scheduling, memory management, and networking.

Performance impact of tuning constants: FIO throughput on HDD shows a massive jump with increased request counts, while RocksDB on NVMe SSD shows improved latency.

Key findings from the evaluation include:

  • Significant Performance Gains: Tuning the block-layer constant BLK_MAX_REQUEST_COUNT resulted in a 50x throughput improvement on HDDs and a 1.2x improvement on NVMe SSDs.
  • Latency Reduction: Selective tuning for TCP CUBIC reduced tail latency by 81% for long-distance NGINX connections.
  • Rapid Responsiveness: KernelX applies new policies in milliseconds, compared to the minutes required by traditional live patching.
  • Minimal Overhead: The system introduces negligible runtime overhead, typically less than 1% for most workloads, even under high-frequency probe triggering.
  • Generality: KernelX successfully supported 99.3% of the constants tested, demonstrating its broad applicability across the kernel.

Discussion and Limitations

KernelX demonstrates that constants possess "structural semantics," allowing their changes to be represented as predictable mathematical relationships. By decoupling the tuning mechanism from the policy via eBPF, KernelX enables context-aware optimization (e.g., process-specific batch sizes) without modifying core kernel logic.

However, some limitations remain. KernelX cannot tune constants that define memory layouts, such as static array sizes or struct padding. Additionally, the initial offline analysis requires approximately 18 minutes per constant. Despite these constraints, KernelX provides a robust foundation for future AI-driven auto-tuning, where reinforcement learning agents could continuously optimize kernel parameters for dynamic, real-world workloads.

Summary updated

BibTeX
@misc{chen2025principled,
  author = {Zhongjie Chen and Wentao Zhang and Yulong Tang and Ran Shu and Fengyuan Ren and Tianyin Xu and Jing Liu},
  title = {{Principled Performance Tunability in Operating System Kernels}},
  year = {2025},
  eprint = {2512.12530},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.12530},
}
Figure