description: LWN and Phoronix update @20221110

This commit is contained in:
Cheng Jian
2022-11-22 20:44:53 +08:00
parent 40610b6a13
commit b017085aa0
4 changed files with 73 additions and 3 deletions
+16
View File
@@ -1014,6 +1014,22 @@ openEuler 提供了 [openEuler/prefetch_tuning](https://gitee.com/openeuler/pref
| 2022/08/05 | Rik van Riel <riel@surriel.com> | [x86,mm: print likely CPU at segfault time](https://lore.kernel.org/all/20220805101644.2e674553@imladris.surriel.com) | 内核将尝试打印发生 SEG 错误的 CPU 核, 通过在发生 SEG 故障的地方打印 CPU 核, 这些信息可能有助于发现故障 CPU 而成为现实. | v3 ☐☑✓ | [LORE](https://lore.kernel.org/all/20220805101644.2e674553@imladris.surriel.com) |
## 6.12 P-State
-------
[phoronix-P-State EPP Linux & Open-Source News](https://www.phoronix.com/search/P-State%20EPP)
[How To Use The New AMD P-State Driver With Linux 5.17](https://www.phoronix.com/news/AMD-P-State-How-To)
[AMD Making It Easier To Switch To Their New P-State CPU Frequency Scaling Driver](https://www.phoronix.com/news/AMD-Easier-P-State-Usage)
[AMD P-State EPP Driver Updated For More Power/Performance Control On Linux](https://www.phoronix.com/news/AMD-P-State-EPP-v4)
[New Patches Allow More Easily Managing The AMD P-State Linux Driver](https://www.phoronix.com/news/AMD-P-State-Built-In-Options)
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:---:|:----:|:---:|:----:|:---------:|:----:|
| 2022/11/11 | Perry Yuan <Perry.Yuan@amd.com> | [Implement AMD Pstate EPP Driver](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=38fec059bb69793f38cfa7a671d4bdbfe2a647aa) | TODO | v4 ☐☑✓ 5.17-rc1 | [LORE v4,0/9](https://lore.kernel.org/all/20221110175847.3098728-1-Perry.Yuan@amd.com)<br>*-*-*-*-*-*-*-* <br>[LORE v7,00/14](https://lore.kernel.org/lkml/20211224010508.110159-1-ray.huang@amd.com) |
| 2022/03/25 | Mario Limonciello <mario.limonciello@amd.com> | [Improve usability for amd-pstate](https://lore.kernel.org/all/20220325054228.5247-1-mario.limonciello@amd.com) | TODO | v1 ☐☑✓ | [LORE v1,0/3](https://lore.kernel.org/all/20220325054228.5247-1-mario.limonciello@amd.com)<br>*-*-*-*-*-*-*-* <br>[LORE v3,0/6](https://lore.kernel.org/linux-pm/20220414164801.1051-1-mario.limonciello@amd.com) |
<br>
+5 -1
View File
@@ -363,9 +363,10 @@ $reclaim = current\_mem \times reclaim\_ratio \times max(0,1 \frac{psi_some}
| 2021/02/02 | Kan Liang <kan.liang@linux.intel.com> | [perf stat: Support L2 Topdown events](https://lore.kernel.org/lkml/1612296553-21962-9-git-send-email-kan.liang@linux.intel.com) | perf stat 支持 Level 2 级别 topdown 分析. [perf core PMU support for Sapphire Rapids (User tools)](https://lore.kernel.org/lkml/1612296553-21962-1-git-send-email-kan.liang@linux.intel.com) 系列中的其中一个补丁. | v1 ☑ 5.12-rc1 | [PatchWork 1/4](https://lore.kernel.org/lkml/1612296553-21962-9-git-send-email-kan.liang@linux.intel.com) |
| 2017/08/31 | Andi Kleen <andi@firstfloor.org> | [perf arm64 metricgroup support](https://lore.kernel.org/all/20170831194036.30146-1-andi@firstfloor.org) | 为 perf stat 添加[对 JSON 文件中指定的独立指标](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b18f3e365019de1a5b26a851e123f0aedcce881f) 的通用支持. 这些指标是一个公式, 它使用多个事件来计算更高级别的结果(例如 IPC, TOPDOWN 分析等). 添加一个新的 `-M /--metrics` 选项来添加指定的度量或度量组. 并增加了对 Intel X86 平台的支持. 通过这些 JSON 文件定义的事件组合度量, 可以很好的支持 TOPDOWN 分析. | v3 ☑ 4.15-rc1 | [PatchWork v3,00/11](https://lore.kernel.org/all/20170831194036.30146-1-andi@firstfloor.org) |
| 2020/09/11 | Kan Liang <kan.liang@linux.intel.com> | [TopDown metrics support for Ice Lake (perf tool)](https://lore.kernel.org/lkml/20200911144808.27603-1-kan.liang@linux.intel.com) | 为 perf metrics 分析增加对 Ice Lake 的支持. 将原本 group 重命名为 topdown. | v3 ☑ 5.10-rc1 | [PatchWork v3,0/4](https://lore.kernel.org/lkml/20200911144808.27603-1-kan.liang@linux.intel.com) |
| 2021/04/07 | John Garry <john.garry@huawei.com> | [perf arm64 metricgroup support](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1617791570-165223-1-git-send-email-john.garry@huawei.com) | perf 支持 HiSilicon hip08 平台的 topdown metric. 支持到 Level 3. 自此鲲鹏 920 的 ARM64 服务器上, 可以使用:<br>`sudo perf stat -M TopDownL1 sleeep 1`<br>来进行 TopDown 分析了. | v1 ☑ 5.13-rc1 | [PatchWork 0/5](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1614784938-27080-1-git-send-email-john.garry@huawei.com)<br>*-*-*-*-*-*-*-* <br>[PatchWork v2,0/6](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1616668398-144648-1-git-send-email-john.garry@huawei.com)<br>*-*-*-*-*-*-*-* <br>[PatchWork v3,0/6](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1617791570-165223-1-git-send-email-john.garry@huawei.com) |
| 2021/04/07 | John Garry <john.garry@huawei.com> | [perf arm64 metricgroup support](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=0cc177cfc95d565e1a458136a592b0bd6d487db0) | perf 支持 HiSilicon hip08 平台的 topdown metric. 支持到 Level 3. 自此鲲鹏 920 的 ARM64 服务器上, 可以使用:<br>`sudo perf stat -M TopDownL1 sleeep 1`<br>来进行 TopDown 分析了. | v1 ☑ 5.13-rc1 | [PatchWork 0/5](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1614784938-27080-1-git-send-email-john.garry@huawei.com)<br>*-*-*-*-*-*-*-* <br>[PatchWork v2,0/6](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1616668398-144648-1-git-send-email-john.garry@huawei.com)<br>*-*-*-*-*-*-*-* <br>[PatchWork v3,0/6](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1617791570-165223-1-git-send-email-john.garry@huawei.com) |
| 2022/05/28 | zhengjun <zhengjun.xing@linux.intel.com> | [perf vendor events intel: Add metrics for Sapphirerapids](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=1bcca2b1bd67f3c0e5c3a88ed16c6389f01a5b31) | TODO | v2 ☑✓ 5.19-rc1 | [LORE v2,0/2](https://lore.kernel.org/all/20220528095933.1784141-1-zhengjun.xing@linux.intel.com) |
| 2022/08/25 | zhengjun.xing@linux.intel.com <zhengjun.xing@linux.intel.com> | [perf stat: Capitalize topdown metricsnel.org/all/20220825015458.3252239-1-zhengjun.xing@linux.intel.com) | TODO | v1 ☐☑✓ | [LORE](https://lore.kernel.org/9-1-zhengjun.xing@linux.intel.com) |
| 2022/10/21 | Shang XiaoJing <shangxiaojing@huawei.com> | [perf vendor events arm64: Fix incorrect metrics and improve readability](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=e9229d5b6254a75291536f582652c599957344d2) | TODO | v2 ☑✓ 6.1-rc3 | [LORE v2,0/3](https://lore.kernel.org/all/20221021105035.10000-1-shangxiaojing@huawei.com) |
## 11.3 Userspace counter access
@@ -489,6 +490,9 @@ x86 和 arm64 都支持直接访问用户空间中的事件计数器. 访问序
| 2021/04/07 | Bill Wendling <morbo@google.com> | [pgo: add clang's Profile Guided Optimization infrastructure](https://lore.kernel.org/all/20210407211704.367039-1-morbo@google.com) | 20210116094357.3620352-1-morbo@google.com | v9 ☐☑✓ | [LORE](https://lore.kernel.org/all/20210407211704.367039-1-morbo@google.com) |
| 2021/4/29 | Wende Tan <twd2.me@gmail.com> | [x86: Enable clang LTO for 32-bit as well](https://patchwork.kernel.org/project/linux-riscv/cover/20210719205208.1023221-1-twd2.me@gmail.com) | CLANG LTO 支持 X86 32 位. | v1 ☑ 5.14-rc1 | [LKML](https://lkml.org/lkml/2021/4/29/873) |
| 2021/07/19 | Wende Tan <twd2.me@gmail.com> | [RISC-V: build: Allow LTO to be selected](https://patchwork.kernel.org/project/linux-riscv/cover/20210719205208.1023221-1-twd2.me@gmail.com) | NA | v1 ☐ | [Patchwork 0/3](https://patchwork.kernel.org/project/linux-riscv/cover/20210719205208.1023221-1-twd2.me@gmail.com) |
| 2022/11/14 | Jiri Slaby (SUSE) <jirislaby@kernel.org> | [gcc-LTO support for the kernel](https://lore.kernel.org/all/20221114114344.18650-1-jirislaby@kernel.org) | [Patches Posted For GCC LTO Optimizing The Linux Kernel](https://www.phoronix.com/news/GCC-LTO-Linux-2022) | v1 ☐☑✓ | [LORE v1,00/46](https://lore.kernel.org/all/20221114114344.18650-1-jirislaby@kernel.org) |
4. BOLT'ing
+1 -1
View File
@@ -296,7 +296,7 @@ Google 的 Joel Fernandes 等发现 RCU 并没有很好的节能, 在 Android
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2022/10/19 | Paul E. McKenney <paulmck@kernel.org> | [Lazy call_rcu() updates for v6.2](https://lore.kernel.org/all/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1) | TODO | v6 ☐☑✓ | [LORE v6,0/14](https://lore.kernel.org/all/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1) |
| 2022/10/19 | Paul E. McKenney <paulmck@kernel.org> | [Lazy call_rcu() updates for v6.2](https://lore.kernel.org/all/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1) | TODO | v6 ☐☑✓ | [LORE v6,00/14](https://lore.kernel.org/all/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1)<br>*-*-*-*-*-*-*-* <br>[LORE 00/16](https://lore.kernel.org/all/20221122010408.GA3799268@paulmck-ThinkPad-P17-Gen-1) |
# 6 FUTEX
+51 -1
View File
@@ -535,13 +535,17 @@ linux 调度器定义了多个调度类, 不同调度类的调度优先级不同
### 1.5.4 SMT
-------
#### 1.5.4.1 SMT aware
-------
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2011/12/15 | Peter Zijlstra <peterz@infradead.org> | [sched: Avoid SMT siblings in select_idle_sibling() if possible](https://lore.kernel.org/patchwork/cover/274702) | 如果有共享缓存的空闲核心, 避免 select_idle_sibling() 选择兄弟线程. | v1 ☐ | [PatchWork v1](https://lore.kernel.org/patchwork/cover/274702) |
| 2020/10/23 | Josh Don <joshdon@google.com> | [sched: better handling for busy polling loops](https://lore.kernel.org/all/20201023032944.399861-1-joshdon@google.com) | 20201023032944.399861-1-joshdon@google.com | v1 ☐☑✓ | [LORE v1,0/3](https://lore.kernel.org/all/20201023032944.399861-1-joshdon@google.com) |
| 2021/11/16 | Peng Wang <rocking@linux.alibaba.com> | [Add busy loop polling for idle SMT](https://lore.kernel.org/all/cover.1637062971.git.rocking@linux.alibaba.com) | SMT 级别的忙轮询等待. 当启用硬件 SMT 时, 在一个 CPU 的空闲和忙碌状态之间切换将导致同一核心上的同级 CPU 的性能波动. 在一个 SMT CPU 上需要稳定的性能时, 无论同一核心上的同级 CPU 是否空闲, 都需要一致的反馈, 而不期望有噪音. 原始 cpu_idle_force_poll 使用 cpu_relax() 等待被 IPI 唤醒, 而此 smt_idle_force_poll 使用忙循环来提供一致的 SMT 管道干扰. 可以使用 cgroup 的 cpu.smt_idle_poll 为特定任务配置启用忙循环轮询. | v1 ☐ | [PatchWork v1](https://lore.kernel.org/all/cover.1637062971.git.rocking@linux.alibaba.com) |
#### 1.5.4.2 SMT scheduling/core scheduling vs coscheduling
-------
core_scheduling 与 coscheduling
@@ -579,6 +583,43 @@ coscheduling 协同调度是为了解决云服务场景, 为不同用户提供
| 2022/06/28 | Cruz Zhao <CruzZhao@linux.alibaba.com> | [sched/core: Optimize load balance of core scheduling](https://lore.kernel.org/all/1656403045-100840-1-git-send-email-CruzZhao@linux.alibaba.com) | 相同 cookie 的任务被认为是相互信任的, 可以在 SMT 上的两个兄弟 CPU 上运行, 它们可以在选择下一个任务时配对, 并且可以避免强制闲置. 为了实现这个目标, 必须统计运行队列中有多少带有此 cookie 的任务. 当进行此统计时, 作者也发现一个错误, 当我们更新一个未写入 cookie 的任务的 cookie 时, 任务不会进入 core 的 rbtree, 所以作者同时也修复了这个错误. | v1 ☐☑✓ | [LORE v1,0/3](https://lore.kernel.org/all/1656403045-100840-1-git-send-email-CruzZhao@linux.alibaba.com) |
| 2022/09/29 | Cruz Zhao <CruzZhao@linux.alibaba.com> | [sched/core: Optimize the process of picking the max prio task for the core](https://lore.kernel.org/all/1664435913-57227-1-git-send-email-CruzZhao@linux.alibaba.com) | TODO | v1 ☐☑✓ | [LORE](https://lore.kernel.org/all/1664435913-57227-1-git-send-email-CruzZhao@linux.alibaba.com)<br>*-*-*-*-*-*-*-* <br>[LORE](https://lore.kernel.org/all/1664767168-30029-1-git-send-email-CruzZhao@linux.alibaba.com) |
#### 1.5.4.3 SMT 驱离(SMT expeller)技术
-------
| 资料 | 描述 |
|:---:|:----:|
| [openEuler 资源利用率提升之道 04: CPU 抢占和 SMT 隔离控制](https://blog.csdn.net/openEuler_/article/details/127021735) | 本文详细介绍并分享关于提升 CPU 资源隔离的混部技术细节: ① CPU 抢占, ② SMT 隔离控制. |
在某些线上业务场景中, 使用超线程情况下的 QPS 比未使用超线程时下降明显, 并且相应 RT 也增加了不少. 根本原因跟超线程的物理性质有关, 超线程技术在一个物理核上模拟两个逻辑核, 两个逻辑核具有各自独立的寄存器 (eax、ebx、ecx、msr 等等) 和 APIC, 但会共享使用物理核的执行资源, 包括执行引擎、L1/L2 缓存、TLB 和系统总线等等. 这就意味着, 如果一对 HT 的一个核上跑了在线任务, 与此同时它对应的 HT 核上跑了一个离线任务, 那么它们之间是会发生竞争的, 这就是我们需要解决的问题.
为了尽可能减轻这种竞争的影响, 我们想要让一个核上的在线任务执行的时候, 它对应的 HT 上不再运行离线任务; 或者当一个核上有离线任务运行的时候, 在线任务调度到了其对应的 HT 上时, 离线任务会被驱赶走. 听起来离线混得很惨对不对?但是这就是我们保证 HT 资源不被争抢的机制.
SMT expeller 特性是基于 Group Identity 框架进一步实现了超线程 (HT) 隔离调度, 保障高优先级业务不会受到来自 HT 的低优先级任务干扰. 通过 Group Identity 框架进一步实现的超线程调度隔离,
可以很好保障高优先级业务不会受到来自对应 HT 上的低优先级任务的干扰.
openEuler-22.03 提供了内核驱离的特性, 通过 CONFIG_QOS_SCHED_SMT_EXPELLER 控制.
```cpp
8090ab77223b sched: Add tracepoint for qos smt expeller
42f42feeaae6 sched: Add statistics for qos smt expeller
fd5207be48fa sched: Implement the function of qos smt expeller
4e57e412b84a sched: Introduce qos smt expeller for co-location
```
OpenAnolis 通过 Group Identity 提供了 SMT Expeller 的能力.
```cpp
96025a924590 ck: sched: enable group identity
f0f2e04c7120 ck: sched: fix the performence regression caused by update_rq_on_expel()
90a0ac11f9ce ck: sched: Introduce sched_feat ID_LAST_HIGHCLASS_STAY
8915a69b71ea ck: sched: fix the bug that nr_high_running underflow
4901599bcf78 ck: sched: rescue the expellee on migration
a789992b7674 ck: sched: introduce 'idle seeker' and ID_IDLE_AVG
4f4324674078 ck: sched: introduce group identity 'idle saver'
9372f9beab42 ck: sched: introduce group identity 'smt expeller'
b37e67a6c648 ck: sched: introduce per-cgroup identity
```
# 2 组调度支持(Group Scheduling)
@@ -5355,6 +5396,15 @@ Xen 的 CPU 调度算法主要有 3 种: BVT(borrowed virtual time)调度算法
### 8.9.3 混部场景(在离线)
-------
| 资料 | 描述 |
|:---:|:----:|
| [阿里大规模业务混部下的全链路资源隔离技术演进](https://developer.aliyun.com/article/807824) | 作为混部实践推出系列的开篇, 介绍资源隔离技术在混部中的重要性、其落地挑战及我们的应对思路. |
| [腾讯云原生 - 混部之殇 - 论云原生资源隔离技术之 CPU 隔离(一)](https://www.cnblogs.com/tencent-cloud-native/p/14754230.html) | TencentOS Server 的混部方案. |
| [B 站云原生混部技术实践](https://blog.csdn.net/weixin_45583158/article/details/126736881) | 哔哩哔哩资深开发工程师许龙讲解分享 B 站云平台的混部实践. |
| [资源隔离技术之 CPU 隔离](https://www.bilibili.com/read/cv19377726) | B 站系统部操作系统 (SYS-OS) 团队对龙蜥社区开源内核的 Group Identity(以下简称 GI) 特性的调研. |
| [Group Identity 功能说明](https://help.aliyun.com/document_detail/338407.html) | Alibaba Cloud Linux 2 从内核版本 kernel-4.19.91-24.al7 开始支持 Group Identity 功能, 您可以通过该功能为每一个 CPU cgroup 设置不同的身份标识, 以区分不同 CPU cgroup 中进程任务的优先级. |
#### 8.9.3.1 在离线混部基本思路
-------