目录
收集工作中遇到的问题,及收集的资料,以便后续成文
基于eBPF的AI Kernel观测_哔哩哔哩_bilibili 基于eBPF的AI Kernel观测
主要解决安全启动问题
中国软件杯 - ELF文件的签名与验证 | ningyuv's blog 也是一个赛题
LSM BPF
https://www.kernel.org/doc/html/latest/bpf/bpf_lsm.html
涉及linux lsm模块。另外开源工具,支持校验加载模块:
NUAA 的作品GitHub - NUAA-WatchDog/linux-elf-binary-signer: ✒️ Adding digital signature into ELF binary files.
主要解决 在线内核的更新问题
内核热补丁技术揭秘 - kk Blog —— 通用基础 (abcdxyzk.github.io)
Linux 4.1内核热补丁成功实践 - 知乎 (zhihu.com) 内核热补丁成功实践 ,讲述了top工具表现为bug,实际影响不大。及在线几万台服务器更新内核的步骤考虑。
应用程序补丁 : 应用程序热补丁(一):几行代码构造免重启修复补丁_文化 & 方法_王超_InfoQ精选文章
kpatch的具体实施 https://access.redhat.com/solutions/2206511
新方法 sudo kpatch list (可以列出有哪些热补丁信息,也就是说有单独热补丁的仓库,里面包括对应的热补丁包)
Loaded patch modules:
kpatch_3_10_0_1062_1_1 [enabled]
Installed patch modules:
kpatch_3_10_0_1062_1_1 (3.10.0-1062.el7.x86_64)
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/applying-patches-with-kernel-live-patching_managing-monitoring-and-updating-the-kernel RHEL 热补丁实战
热补丁技术对比 https://mkyong.com/linux/an-introduction-to-kernel-live-patching-on-linux/
https://www.kernelcare.com/ 热补丁公司
主要资源隔离
CPU 限额带来的应用高延时分析
https://engineering.indeedblog.com/blog/2019/12/unthrottled-fixing-cpu-limits-in-the-cloud/
https://www.redhat.com/sysadmin/cgroups-part-one
此系列分了四部分,详细讲解了 cgroups,读完及实践操作后,完全明了了。
https://gitee.com/Tencent/tencentos-kernel 腾讯OS,主要关注他们对哪些点做了处理。
https://blog.csdn.net/qq_15437629/article/details/114440930 内存错误检测工具-AddressSanitizer(ASAN)
https://github.com/anbox/anbox 安卓模拟器
为那些依赖特定且通常对延迟或性能有极端要求的工作负载设置提供支持。
目的: 也就是说隔离出来的核运行特定的任务,尽量减少系统中断带来的时延抖动。
CPU 隔离:简介_硬件_Frederic Weisbecker_InfoQ精选文章
这个系列的文章系统阐述了此功能。
LMbench - Tools for Performance Analysis (sourceforge.net) it measures two key features: latency and bandwidth. 主要测试延时和带宽
GitHub - raas/mbw: Memory Bandwidth Benchmark 内存带宽测试,工具比较简单,方便移植到其他架构上
./mbw 1000 问题,几种测试的带宽差异蛮大的,具体因为及哪个可以视为理论值?
Long uses 8 bytes. Allocating 2*131072000 elements = 2097152000 bytes of memory.
Using 262144 bytes as blocks for memcpy block copy test.
Getting down to business... Doing 10 runs per test.
0 Method: MEMCPY Elapsed: 0.12366 MiB: 1000.00000 Copy: 8086.559 MiB/s
1 Method: MEMCPY Elapsed: 0.12259 MiB: 1000.00000 Copy: 8157.405 MiB/s
2 Method: MEMCPY Elapsed: 0.12563 MiB: 1000.00000 Copy: 7959.819 MiB/s
3 Method: MEMCPY Elapsed: 0.15079 MiB: 1000.00000 Copy: 6631.827 MiB/s
4 Method: MEMCPY Elapsed: 0.15097 MiB: 1000.00000 Copy: 6623.789 MiB/s
5 Method: MEMCPY Elapsed: 0.15204 MiB: 1000.00000 Copy: 6577.346 MiB/s
6 Method: MEMCPY Elapsed: 0.14639 MiB: 1000.00000 Copy: 6830.928 MiB/s
7 Method: MEMCPY Elapsed: 0.14832 MiB: 1000.00000 Copy: 6742.088 MiB/s
8 Method: MEMCPY Elapsed: 0.15085 MiB: 1000.00000 Copy: 6629.102 MiB/s
9 Method: MEMCPY Elapsed: 0.15019 MiB: 1000.00000 Copy: 6658.056 MiB/s
AVG Method: MEMCPY Elapsed: 0.14214 MiB: 1000.00000 Copy: 7035.139 MiB/s
0 Method: DUMB Elapsed: 0.97909 MiB: 1000.00000 Copy: 1021.358 MiB/s
1 Method: DUMB Elapsed: 1.05770 MiB: 1000.00000 Copy: 945.443 MiB/s
2 Method: DUMB Elapsed: 1.08488 MiB: 1000.00000 Copy: 921.758 MiB/s
3 Method: DUMB Elapsed: 1.01668 MiB: 1000.00000 Copy: 983.597 MiB/s
4 Method: DUMB Elapsed: 0.98891 MiB: 1000.00000 Copy: 1011.210 MiB/s
5 Method: DUMB Elapsed: 0.81715 MiB: 1000.00000 Copy: 1223.769 MiB/s
6 Method: DUMB Elapsed: 0.88959 MiB: 1000.00000 Copy: 1124.108 MiB/s
7 Method: DUMB Elapsed: 0.83550 MiB: 1000.00000 Copy: 1196.884 MiB/s
8 Method: DUMB Elapsed: 0.84141 MiB: 1000.00000 Copy: 1188.481 MiB/s
9 Method: DUMB Elapsed: 1.10843 MiB: 1000.00000 Copy: 902.176 MiB/s
AVG Method: DUMB Elapsed: 0.96194 MiB: 1000.00000 Copy: 1039.571 MiB/s
0 Method: MCBLOCK Elapsed: 0.13688 MiB: 1000.00000 Copy: 7305.562 MiB/s
1 Method: MCBLOCK Elapsed: 0.12809 MiB: 1000.00000 Copy: 7806.828 MiB/s
2 Method: MCBLOCK Elapsed: 0.13086 MiB: 1000.00000 Copy: 7641.930 MiB/s
3 Method: MCBLOCK Elapsed: 0.12915 MiB: 1000.00000 Copy: 7742.995 MiB/s
4 Method: MCBLOCK Elapsed: 0.12508 MiB: 1000.00000 Copy: 7995.075 MiB/s
5 Method: MCBLOCK Elapsed: 0.12820 MiB: 1000.00000 Copy: 7800.129 MiB/s
6 Method: MCBLOCK Elapsed: 0.13012 MiB: 1000.00000 Copy: 7685.391 MiB/s
7 Method: MCBLOCK Elapsed: 0.12442 MiB: 1000.00000 Copy: 8037.164 MiB/s
8 Method: MCBLOCK Elapsed: 0.12386 MiB: 1000.00000 Copy: 8073.762 MiB/s
9 Method: MCBLOCK Elapsed: 0.12892 MiB: 1000.00000 Copy: 7756.809 MiB/s
AVG Method: MCBLOCK Elapsed: 0.12856 MiB: 1000.00000 Copy: 7778.608 MiB/s
Intel® Memory Latency Checker v3.9a intel提供的内存延迟的测试工具
odifies the H/W prefetch control MSR to enable/disable prefetchers for latency and b/w measurements. Refer readme documentation on running without root privileges 预取控制对带宽的影响。理论上讲打开预取可以更好的测试真实的带宽。
Index of /stream/FTP/Code (virginia.edu) stram源码
MEMORY BANDWIDTH: STREAM BENCHMARK PERFORMANCE RESULTS (virginia.edu)
官网
编译: