Lune

ASPLOS2024顶会

Merlin: Multi-tier Optimization of eBPF Code for Performance and Compactness

Jinsong Mao, Hailun Ding, Juan Zhai, Shiqing Ma

摘要

eBPF (extended Berkeley Packet Filter) significantly enhances observability, performance, and security within the Linux kernel, playing a pivotal role in various real-world applications. Implemented as a register-based kernel virtual machine, eBPF features a customized Instruction Set Architecture (ISA) with stringent kernel safety requirements, e.g., a limited number of instructions. This constraint necessitates substantial optimization efforts for eBPF programs to meet performance objectives. Despite the availability of compilers supporting eBPF program compilation, existing tools often overlook key optimization opportunities, resulting in suboptimal performance. In response, this paper introduces Merlin, an optimization framework leveraging customized LLVM passes and bytecode rewriting for Instruction Representation (IR) transformation and bytecode refinement. Merlin employs two primary optimization strategies, i.e., instruction merging and strength reduction. These optimizations are deployed before eBPF verification. We evaluate Merlin across 19 XDP programs (drawn from the Linux kernel, Meta, hXDP, and Cilium) and three eBPF-based systems (Sysdig, Tetragon, and Tracee, each comprising several hundred eBPF programs). The results show that all optimized programs pass the kernel verification. Meanwhile, Merlin can reduce number of instructions by 73% and runtime overhead by 60% compared with the original programs. Merlin can also improve the throughput by 0.59% and reduce the latency by 5.31%, compared to state-of-the-art technique K2 , while being 10 6 times faster and more scalable to larger and more complex programs without additional manual efforts.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • RAIN: Refinable Attack Investigation with On-demand Inter-Process Information Flow Tracking 引用了 ProTracer: Towards Practical Provenance Tracing by Alternating Between Logging and Tainting
  • Electrode: Accelerating Distributed Protocols with eBPF 引用了 XRP: In-Kernel Storage Functions with eBPF
  • Virtualizing eBPF with Late-Binding 引用了 Electrode: Accelerating Distributed Protocols with eBPF
  • Virtualizing eBPF with Late-Binding 引用了 XRP: In-Kernel Storage Functions with eBPF
  • HIVE: A Hardware-assisted Isolated Execution Environment for eBPF on AArch64 引用了 XRP: In-Kernel Storage Functions with eBPF
  • Revealing the Unstable Foundations of eBPF-Based Kernel Extensions 引用了 Verifying the Verifier: eBPF Range Analysis Verification
  • Revealing the Unstable Foundations of eBPF-Based Kernel Extensions 引用了 Electrode: Accelerating Distributed Protocols with eBPF
  • Revealing the Unstable Foundations of eBPF-Based Kernel Extensions 引用了 XRP: In-Kernel Storage Functions with eBPF
  • eNetSTL: Towards an In-kernel Library for High-Performance eBPF-based Network Functions 引用了 Electrode: Accelerating Distributed Protocols with eBPF
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper6

  1. eNetSTL: Towards an In-kernel Library for High-Performance eBPF-based Network FunctionsBin Yang, Dian Shen, Junxue Zhang, Hanlin Yang 等EuroSys 2025 · 9 次引用
  2. HIVE: A Hardware-assisted Isolated Execution Environment for eBPF on AArch64Peihua Zhang, Chenggang Wu, Xiangyu Meng, Yinqian Zhang 等USENIX Security 2024 · 8 次引用
  3. The HitchHiker's Guide to High-Assurance System Observability Protection with Efficient Permission SwitchesChuqi Zhang, Jun Zeng, Yiming Zhang, Adil Ahmad 等CCS 2024 · 4 次引用
  4. Revealing the Unstable Foundations of eBPF-Based Kernel ExtensionsShawn Wanxiang Zhong, Jing Liu, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-DusseauEuroSys 2025 · 4 次引用
  5. Virtualizing eBPF with Late-BindingJing Zhang, Xiaguannan Song, Dong Du, Yubin Xia 等OSDI 2026

它引用的 Paper10

  1. ProTracer: Towards Practical Provenance Tracing by Alternating Between Logging and TaintingShiqing Ma, Xiangyu Zhang, Dongyan XuNDSS 2016 · 253 次引用
  2. RAIN: Refinable Attack Investigation with On-demand Inter-Process Information Flow TrackingYang Ji, Sangho Lee, Evan Downing, Weiren Wang 等CCS 2017 · 119 次引用
  3. XRP: In-Kernel Storage Functions with eBPFYuhong Zhong, Haoyu Li, Yu Jian Wu, Ioannis Zarkadas 等OSDI 2022 · 100 次引用
  4. Electrode: Accelerating Distributed Protocols with eBPFYang Zhou, Zezhou Wang, Sowmya Dharanipragada, Minlan YuNSDI 2023 · 78 次引用
  5. Verifying the Verifier: eBPF Range Analysis VerificationHarishankar Vishwanathan, Matan Shachnai, Srinivas Narayana, Santosh NagarakatteCAV 2023 · 37 次引用

相关 Paper

  1. EPSO: A Caching-Based Efficient Superoptimizer for BPF BytecodeQian Zhu, Yuxuan Liu, Ziyuan Zhu, Shangqing Liu 等ASE 2025
  2. VEP: A Two-stage Verification Toolchain for Full eBPF ProgrammabilityXiwei Wu, Yueyang Feng, Tianyi Huang, Xiaoyang Lu 等NSDI 2025 · 8 次引用
  3. Synthesizing safe and efficient kernel extensions for packet processingQiongwen Xu, Michael D. Wong, Tanvi Wagle, Srinivas Narayana 等SIGCOMM 2021 · 30 次引用
  4. hXDP: Efficient Software Packet Processing on FPGA NICsMarco Spaziani Brunella, Giacomo Belocchi, Marco Bonola, Salvatore Pontarelli 等OSDI 2020 · 25 次引用
  5. LDBF: Deep Exploration of eBPF Runtime via LLM-Driven Program Generation and Adaptive Context OrchestrationYinhao Hu, Kaiyan Mei, Zeyu Sun, Quan Sun 等CCS 2026
黄昏的海面,两侧是细线勾勒的悬崖