当前位置:首页 > 报告详情

分会场1_Leon Hwang_bpf:Fixed tailcall issues_报告PPT.pdf

上传人: 科*** 编号:713417 2025-06-08 28页 493.11KB

1、bpf:Fixed tailcall issues第三届 eBPF开发者大会Leon Hwang2025/04/19中国 西安 Author of eBPF Talk Contributor of pwru,eCapture,drgn Creator of bpfsnoop Independent bpf subsystem contributor BPF contributions:https:/bit.ly/4d9eOWa Blog:https:/ GitHub:https:/ bpfsnoop:https:/第三届eBPF开发者大会Profile1.Fixed tailcall infi

2、nite loop issue caused by trampoline2.Fixed tailcall hierarchy issue3.Fixed crash caused by freplace+prog_array4.Fixed tailcall infinite loop issue caused by freplaceTo explain each issue:How did I find it?What was it?How to fix it?第三届eBPF开发者大会Agendatailcall in bpf2bpf on x86第三届 eBPF开发者大会Prerequisit

3、e:中国 西安 How does tailcall in bpf2bpf work?bpf2bpf means a bpf prog calls another bpf prog directly.The callee bpf prog is named subprog.tailcall in bpf2bpf is the subprog has bpf_tail_call().tail_call_cnt is used to limit the total times of calling bpf_tail_call().tail_call_cnt is propagated by%rax

4、between the caller and the callee.第三届eBPF开发者大会tailcall in bpf2bpf on x860:Fixed tailcall infinite loopissue caused by trampoline第三届 eBPF开发者大会中国 西安 How did I find it?It was found when I studied the 8KiB stack space limit.-When a prog has tailcall,its stack space limits to 256B.-When there are 32 tail

5、calls,the total consumed stack space will be 8Kib+512B at most.第三届eBPF开发者大会Fixed tailcall infinite loop issue caused by trampoline How did I find it?-What if increment the consumed stack space?-What I tried:-Run tailcall in subprog.-Tail callee is the entry prog.-Trace the subprog with fexit in orde

6、r to consume more stack with trampoline.第三届eBPF开发者大会Fixed tailcall infinite loop issue caused by trampoline What was it?-What did I get?-A kernel crash at that time.-Try again?-No tailcall happens=tailcall is skipped.第三届eBPF开发者大会Fixed tailcall infinite loop issue caused by trampoline How to fix it?F

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
本文主要介绍了eBPF开发者大会上Leon Hwang关于bpf tailcall问题的修复工作。关键点如下: 1. 修复了由trampoline引起的tailcall无限循环问题,通过在x86架构中传播`tail_call_cnt`解决。 2. 解决了tailcall层次结构问题,通过将`tail_call_cnt`作为运行时全局变量处理。 3. 修复了由freplace和prog_array导致的崩溃问题,通过防止将freplace程序更新到prog_array地图上解决。 4. 防止了由freplace引起的tailcall无限循环,限制了freplace程序与prog_array的交互。 5. 提出了tailcall问题检测工具。 6. 对未来tailcall的实现提出了改进计划,包括对x86架构上的tailcall实现进行重构,并引入tailcall跟踪器。 引用的核心数据包括:“tail_call_cnt”用于限制tailcall调用次数,以及在解决无限循环问题时对%rax寄存器的使用。
"eBPF尾调用有哪些坑?" "如何避免eBPF程序无限循环?" "未来eBPF尾调用将如何改进?"
客服
商务合作
小程序
服务号
折叠