Extended Berkeley Packet Filter (BPF) has emerged as a powerful method to extend packet-processing functionality in the Linux operating system. BPF allows users to write code in high-level languages (like C or Rust) and execute them at specific hooks in the kernel, such as the network device driver. To ensure safe execution of a user-developed BPF program in kernel context, Linux uses an in-kernel static checker. The checker allows a program to execute only if it can prove that the program is crash-free, always accesses memory within safe bounds, and avoids leaking kernel data. BPF programming is not easy. One, even modest-sized BPF programs are deemed too large to analyze and rejected by the kernel checker. Two, the kernel checker may incorrectly determine that a BPF program exhibits unsafe behaviors. Three, even small performance optimizations to BPF code (e.g., 5% gains) must be meticulously hand-crafted by expert developers. Traditional optimizing compilers for BPF are often inadequate since the kernel checker's safety constraints are incompatible with rule-based optimizations. We present K2, a program-synthesis-based compiler that automatically optimizes BPF bytecode with formal correctness and safety guarantees. K2 produces code with 6--26% reduced size, 1.36%--55.03% lower average packet-processing latency, and 0--4.75% higher throughput (packets per second per core) relative to the best clang-compiled program, across benchmarks drawn from Cilium, Facebook, and the Linux kernel. K2 incorporates several domain-specific techniques to make synthesis practical by accelerating equivalence-checking of BPF programs by 6 orders of magnitude.


翻译:BPF 允许用户以高语言(如 C 或 Rust ) 写入代码,并在内核的特定钩子(如网络设备驱动器)执行代码。为确保在内核中安全执行用户开发的 BPF 程序, Linux 使用一个内核静态检查器。检查器允许一个程序执行,前提是它能够证明程序是无崩溃处理的,总是在安全范围内存取存储器,避免内核数据泄漏。 BPF 程序不易在高语言(如 C 或 Rust ) 中写代码,并在内核中(如网络设备驱动器)。为确保在内核内核部分安全执行用户开发的 BPFP 程序。 Linux 使用一个内核静检查器。只有专家开发者才能精确地手动地对 BPF3 代码(e. g., 5% 增益) 才能执行程序。BPFPFS 传统地优化编译器的编译器往往不够,因为内核内核内核的内核内核内核内核内核内核内核内核内核内核的内核内核内核内核内核内核内核内核内核内核内核内核的内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核的内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核内核

0
下载
关闭预览

相关内容

【经典书】模式识别导论,561页pdf
专知会员服务
79+阅读 · 2021年6月30日
【干货书】机器人元素Elements of Robotics ,311页pdf
专知会员服务
34+阅读 · 2021年4月16日
专知会员服务
25+阅读 · 2021年4月2日
少即是多?非参数语言模型,68页ppt
专知会员服务
22+阅读 · 2020年11月22日
专知会员服务
44+阅读 · 2020年10月31日
神经常微分方程教程,50页ppt,A brief tutorial on Neural ODEs
专知会员服务
70+阅读 · 2020年8月2日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
77+阅读 · 2020年7月26日
已删除
将门创投
5+阅读 · 2019年9月10日
计算机类 | PLDI 2020等国际会议信息6条
Call4Papers
3+阅读 · 2019年7月8日
计算机 | 国际会议信息5条
Call4Papers
3+阅读 · 2019年7月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
计算机类 | 11月截稿会议信息9条
Call4Papers
6+阅读 · 2018年10月14日
分布式TensorFlow入门指南
机器学习研究会
4+阅读 · 2017年11月28日
Arxiv
0+阅读 · 2021年9月16日
Arxiv
0+阅读 · 2021年9月14日
Arxiv
6+阅读 · 2021年6月24日
Arxiv
23+阅读 · 2020年9月16日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
VIP会员
相关VIP内容
【经典书】模式识别导论,561页pdf
专知会员服务
79+阅读 · 2021年6月30日
【干货书】机器人元素Elements of Robotics ,311页pdf
专知会员服务
34+阅读 · 2021年4月16日
专知会员服务
25+阅读 · 2021年4月2日
少即是多?非参数语言模型,68页ppt
专知会员服务
22+阅读 · 2020年11月22日
专知会员服务
44+阅读 · 2020年10月31日
神经常微分方程教程,50页ppt,A brief tutorial on Neural ODEs
专知会员服务
70+阅读 · 2020年8月2日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
77+阅读 · 2020年7月26日
相关资讯
已删除
将门创投
5+阅读 · 2019年9月10日
计算机类 | PLDI 2020等国际会议信息6条
Call4Papers
3+阅读 · 2019年7月8日
计算机 | 国际会议信息5条
Call4Papers
3+阅读 · 2019年7月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
计算机类 | 11月截稿会议信息9条
Call4Papers
6+阅读 · 2018年10月14日
分布式TensorFlow入门指南
机器学习研究会
4+阅读 · 2017年11月28日
Top
微信扫码咨询专知VIP会员