diff --git a/study/kernel/00-DESCRIPTION/ARCH.md b/study/kernel/00-DESCRIPTION/ARCH.md index 7973b3e..2459a9d 100644 --- a/study/kernel/00-DESCRIPTION/ARCH.md +++ b/study/kernel/00-DESCRIPTION/ARCH.md @@ -104,7 +104,7 @@ v5.7 引入了拆分锁检测的支持, 这依赖于 x86_64 intel CPU 遇到拆 | 2021/04/19 | Fenghua Yu | [x86/bus_lock: Set rate limit for bus lock](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=d28397eaf4c27947a1ffc720d42e8b3a33ae1e2a) | 通过限制总线锁的速率而不是杀死进程来缓解拆分锁带来的问题. | v1 ☑✓ 5.14-rc1 | [Patchwork 0/4](https://lore.kernel.org/all/20210419214958.4035512-1-fenghua.yu@intel.com) | | 2022/03/10 | Tony Luck | [Make life miserable for split lockers](https://lore.kernel.org/all/20220310204854.31752-1-tony.luck@intel.com) | 通过强制用户空间对拆分锁进行顺序访问. 在解决问题的同时, 也确保了在这些条件下整体系统性能更好. 参见 [Linux 5.19 To"Make Life Miserable"In Slowing Down Bad Behaving Split-Lock Apps](https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.19-Split-Lock). | v2 ☐☑✓ | [LORE v2,0/2](https://lore.kernel.org/all/20220310204854.31752-1-tony.luck@intel.com) | | 2022/10/24 | Guilherme G. Piccoli | [x86/split_lock: Add sysctl to control the misery mode](https://lore.kernel.org/all/20221024200254.635256-1-gpiccoli@igalia.com) | Splitlock Detector 机制通过人为限制触发了 Splitlock 锁的软件的性能, 从而保证整机的吞吐量和性能. 然后推动触发了对应软件整改和优化自己的代码, 但是一些专用软件特别是闭源软件改起来相对麻烦, 比如 Linux 上 window 游戏等. 这引发了这些 window 游戏性能的大幅度下降, 参见 [Linux Adding New Control Since Its Splitlock Detector Is Wrecking Some Steam Play Games](https://www.phoronix.com/news/Linux-Splitlock-Hurts-Gaming). 现在为 Linux 6.2 添加了一个新的 sysctl 可调参数 "split_lock_reduce", 以便轻松禁用 "痛苦模式" 行为. 当将 split_lock_reduce 设置为 0 时, 只会在内核锁中出现警告, 而不会带来循序存取损失. 默认情况下, 故意的性能降低模式仍然处于活动状态, 但是我们可能会看到 SteamOS 之类的操作系统自动关闭 split_lock_reduce 可调参数. 也有可能我们会看到这个自动调整喜欢野性的游戏模式. 由于它是一个 sysctl 选项, 现在在运行时管理起来比在启动时不得不为内核使用劈开锁检测选项更容易, 但是内核开发人员到目前为止还想保持默认的 “糟糕性能” 模式, 以激励用户空间软件围绕减少劈开锁进行改进. | v3 ☐☑✓ | [LORE](https://lore.kernel.org/all/20221024200254.635256-1-gpiccoli@igalia.com) | -| 2024/04/29 | Ravi Bangoria | [x86/cpu: Add Bus Lock Detect support for AMD](https://lore.kernel.org/all/20240429060643.211-1-ravi.bangoria@amd.com) | [AMD Prepares Linux For "Bus Lock Trap" Feature On Upcoming CPUs](https://www.phoronix.com/news/AMD-Bus-Lock-Trap-Detect-Linux). | v1 ☐☑✓ | [LORE v1,0/3](https://lore.kernel.org/all/20240429060643.211-1-ravi.bangoria@amd.com) | +| 2024/04/29 | Ravi Bangoria | [x86/cpu: Add Bus Lock Detect support for AMD](https://lore.kernel.org/all/20240429060643.211-1-ravi.bangoria@amd.com) | [AMD Prepares Linux For"Bus Lock Trap"Feature On Upcoming CPUs](https://www.phoronix.com/news/AMD-Bus-Lock-Trap-Detect-Linux). | v1 ☐☑✓ | [LORE v1,0/3](https://lore.kernel.org/all/20240429060643.211-1-ravi.bangoria@amd.com) | ### 1.1.2 Sub-Page Write Protection @@ -183,7 +183,7 @@ Intel Architecture Day 2021, 官宣了自己的服务于终端和桌面场景的 | 2021/05/27 | Kan Liang | [perf: Support perf-mem/perf-c2c for AlderLake](https://lkml.org/lkml/2021/4/5/775) | perf 支持 Hybrid CPU(内核态). | v2 ☑ 5.14-rc1 | [LKML v1 0/8](https://lkml.org/lkml/2021/4/5/775), [LKML v2 0/8](https://lkml.org/lkml/2021/5/27/191) | | 2023/02/13 | Zhao Liu | [Introduce hybrid CPU topology](https://lore.kernel.org/all/20230213095035.158240-1-zhao1.liu@linux.intel.com) | 在 QEMU 中引入混合拓扑, 依赖于 QEMU 支持 [Support smp.clusters for x86](https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg03184.html) | v1 ☐☑✓ | [LORE v1,0/52](https://lore.kernel.org/all/20230213095035.158240-1-zhao1.liu@linux.intel.com) | | 2023/11/30 | Zhao Liu | [qom-topo: Abstract Everything about CPU Topology](https://lore.kernel.org/all/20231130144203.2307629-1-zhao1.liu@linux.intel.com) | 关于混合拓扑支持 [Introduce hybrid CPU topology](https://lore.kernel.org/all/20230213095035.158240-1-zhao1.liu@linux.intel.com) 之后的最新尝试, 使用现代 QOM 方法来定义 CPU 拓扑, 基于这种方式, 通过 cli 定义混合拓扑. 列出了详细的 Reference. | v1 ☐☑✓ | [LORE v1,0/41](https://lore.kernel.org/all/20231130144203.2307629-1-zhao1.liu@linux.intel.com) | -| 2024/06/17 | Pawan Gupta | [Add CPU-type to topology](https://lore.kernel.org/all/20240617-add-cpu-type-v1-0-b88998c01e76@linux.intel.com) | 这个 patchset 新增了对 CPU 类型(英特尔 CPUID.1A.EAX[31-24])的支持, 以区分共享相同系列/型号/步进的 P+E、P-only、E-only 混合变体. CPU-type 的用例之一是 CPU 漏洞的受影响 CPU 表, 现在可以使用 CPU-type 过滤不受影响的变体.
补丁 1 在 CPU 拓扑结构中添加了 cpu-type, 并引入了 topology_cpu_type() 来获取 CPU-type.
补丁 2-4 将 get_this_hybrid_cpu_type() 替换为 topology_cpu_type() 的用法.
补丁 5-7 更新 CPU 匹配基础架构, 以使用 CPU-type.
补丁 8 清理了受影响的 CPU 列表.
补丁 9 使用 CPU-type 从 RFDS 受影响列表中排除仅 P 的部件. 参见 phoronix 报道 [Linux To Incorporate Intel CPU Hybrid Topology For Determining Vulnerabilities/Mitigations](https://www.phoronix.com/news/Intel-Hybrid-Topology-Mitigate). | v1 ☐☑✓ | [LORE v1,0/9](https://lore.kernel.org/all/20240617-add-cpu-type-v1-0-b88998c01e76@linux.intel.com) | +| 2024/06/17 | Pawan Gupta | [Add CPU-type to topology](https://lore.kernel.org/all/20240617-add-cpu-type-v1-0-b88998c01e76@linux.intel.com) | 这个 patchset 新增了对 CPU 类型 (英特尔 CPUID.1A.EAX[31-24]) 的支持, 以区分共享相同系列 / 型号 / 步进的 P+E、P-only、E-only 混合变体. CPU-type 的用例之一是 CPU 漏洞的受影响 CPU 表, 现在可以使用 CPU-type 过滤不受影响的变体.
补丁 1 在 CPU 拓扑结构中添加了 cpu-type, 并引入了 topology_cpu_type() 来获取 CPU-type.
补丁 2-4 将 get_this_hybrid_cpu_type() 替换为 topology_cpu_type() 的用法.
补丁 5-7 更新 CPU 匹配基础架构, 以使用 CPU-type.
补丁 8 清理了受影响的 CPU 列表.
补丁 9 使用 CPU-type 从 RFDS 受影响列表中排除仅 P 的部件. 参见 phoronix 报道 [Linux To Incorporate Intel CPU Hybrid Topology For Determining Vulnerabilities/Mitigations](https://www.phoronix.com/news/Intel-Hybrid-Topology-Mitigate). | v1 ☐☑✓ | [LORE v1,0/9](https://lore.kernel.org/all/20240617-add-cpu-type-v1-0-b88998c01e76@linux.intel.com) | @@ -197,7 +197,7 @@ Intel Architecture Day 2021, 官宣了自己的服务于终端和桌面场景的 | 2021/12/16 | Srinivas Pandruvada | [cpufreq: intel_pstate: Update EPP for AlderLake mobile](https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.17-P-State-ADL-Mobile) | 修正 AlderLake 的 EPP. | v1 ☑ 5.17-rc1 | [COMMIT](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b6e6f8beec98ba7541213c506fe908517fdc52b8) | | 2022/04/15 | Zhang Rui | [intel_idle: add AlderLake support](https://lore.kernel.org/all/20220415093951.2677170-1-rui.zhang@intel.com) | 参见 [phoronix 报道](https://www.phoronix.com/scan.php?page=news_item&px=Intel-Idle-Alder-Lake) | v1 ☐☑✓ | [LORE](https://lore.kernel.org/all/20220415093951.2677170-1-rui.zhang@intel.com) | | 2022/10/24 | Rafael J. Wysocki | [cpufreq: intel_pstate: Make HWP calibration work on all hybrid platforms](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=f5c8cf2a4992dd929fa0c2f25c09ee69b8dcbce1) | 修复硬件 P-State(HWP) 校准程序在 Intel 混合 CPU 平台的一些问题.
1. 以前进行这项工作的尝试是基于使用 CPPC, 但事实证明, CPPC 信息对于此目的来说不够可靠, 唯一的方法是对 P 核和 E 核使用硬编码的比例因子(幸运的是, 这与非混合情况下相同). 幸运的是, 迄今为止, P-core 的相同缩放因子适用于所有混合平台. 这个补丁集的第一个补丁通过避免在一个 CPU 上读取的 MSR 值将用于另一个 CPU 的性能扩展的情况, 确保所有 CPU 都将使用来自 MSR 的正确信息. 第二个补丁完善了 hybrid_get_cpu_scaling() 的实现, 用已知的缩放因子作为 cpu->pstate.scaling. | v1 ☑✓ 6.1-rc3 | [LORE v1,0/2](https://lore.kernel.org/all/2258064.ElGaqSPkdT@kreacher) | -| 2024/04/25 | Rafael J. Wysocki | [x86/intel_pstate: Set asymmetric CPU capacity on hybrid systems](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=64a0c5de40d3648a2fc5ff58348c1ff973976da1) | 这个补丁集是为调度器提供基于英特尔硬件的 x86 混合系统上的非对称 CPU 容量信息. 不对称的 CPU 容量信息在混合系统中很重要, 因为它允许以一致的方式计算系统中所有 CPU 的任务利用率, 而不管它们的容量如何. 这反过来又允许 schedutil-cpufreq 调控器在任务在不同容量的 CPU 之间迁移的情况下一致地设置 CPU 性能级别. 它还应该有助于改善混合系统上的任务布局和负载平衡决策, 这是 EAS 的关键. 根据补丁 [3/3] 的更改日志, 有问题的信息来自 MSR_HWP_CAPABILITIES 寄存器, 并由 intel_postate 驱动程序提供给调度器. Patch[2/3]引入了所需的拱形基础设施 (以每 CPU 容量变量的形式), Patch[1/3] 是初步的代码调整. 补丁 [2/3] 所做的更改非常简单, 这就是为什么这个系列被作为 RFC 发送的原因. 也就是说, 它增加了非混合系统和混合系统的开销, 这可能被认为是令人反感的, 尽管开销的增加可以说并不显著. 内存开销是每个 CPU 的一个无符号长变量, 它不是很多 IMV, 还有每个 arch_scale_cpu_capacity()调用站点的额外内存访问开销, 但我并不认为这会引起注意. 在任何情况下, 都可以避免额外的开销, 但代价是使代码变得更复杂(例如, 额外的每 CPU 内存只能在混合系统上动态分配, 必要时可以使用静态分支来访问它). 参见 phoronix 报道 [New Intel P-State Linux Driver Patches To Better Handle Hybrid Core CPUs](https://phoronix.com/news/Intel-P-State-Asymmetic-Hybrid) 和 [Intel P-State Patches Further Tune Linux For Better Scheduling On Hybrid CPUs](https://www.phoronix.com/news/Intel-P-State-Asymmetric-Cap). | v1 ☐☑✓ v6.11-rc1 | [LORE v1,0/3](https://lore.kernel.org/all/7663799.EvYhyI6sBW@kreacher) | +| 2024/04/25 | Rafael J. Wysocki | [x86/intel_pstate: Set asymmetric CPU capacity on hybrid systems](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=64a0c5de40d3648a2fc5ff58348c1ff973976da1) | 这个补丁集是为调度器提供基于英特尔硬件的 x86 混合系统上的非对称 CPU 容量信息. 不对称的 CPU 容量信息在混合系统中很重要, 因为它允许以一致的方式计算系统中所有 CPU 的任务利用率, 而不管它们的容量如何. 这反过来又允许 schedutil-cpufreq 调控器在任务在不同容量的 CPU 之间迁移的情况下一致地设置 CPU 性能级别. 它还应该有助于改善混合系统上的任务布局和负载平衡决策, 这是 EAS 的关键. intel_pstate 使用 MSR_HWP_CAPABILITIES 的 HWP_HIGHEST_PERF 值,通过之前引入的 arch_set_cpu_capacity() 在没有 SMT 的混合系统上设置不对称的 CPU 容量信息. 如果给定系统是混合和非 SMT, 则在初始化所有在线 CPU 并找到具有最大 HWP_HIGHEST_PERF 值的 CPU 后, 新代码将禁用调度器中的 ITMT 支持 (因为它可能会妨碍调度器中的非对称 CPU 容量代码, 该代码通过设置非对称 CPU 容量自动启用). 接下来, 它通过将其 HWP_HIGHEST_PERF 和 SCHED_CAPACITY_SCALE 的乘积除以最大 HWP_HIGHEST_PERF 来计算每个(在线)CPU 的容量. 参见 phoronix 报道 [New Intel P-State Linux Driver Patches To Better Handle Hybrid Core CPUs](https://phoronix.com/news/Intel-P-State-Asymmetic-Hybrid), [Intel P-State Patches Further Tune Linux For Better Scheduling On Hybrid CPUs](https://www.phoronix.com/news/Intel-P-State-Asymmetric-Cap) 和 [New Intel Linux Patches Continue Working To Improve Hybrid CPU Task Placement](https://www.phoronix.com/news/Intel-Linux-Mid-2024-Hybrid). | v1 ☐☑✓ v6.11-rc1 | [2024/04/25, LORE v1,0/3](https://lore.kernel.org/all/7663799.EvYhyI6sBW@kreacher)
*-*-*-*-*-*-*-*
[2024/08/02, LORE v1,0/3](https://lore.kernel.org/all/4908113.GXAFRqVoOG@rjwysocki.net) | @@ -266,7 +266,7 @@ ASYM_PACKING 用于平衡物理核心与 SMT 之间的负载均衡处理 (例如 | 2022/09/09 | Ricardo Neri | [sched: Introduce classes of tasks for load balance](https://lore.kernel.org/all/20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com) | 实现 Thread-Director, 根据应用程序的类型 classes 实现选核和负载均衡. | v1 ☐☑✓ | [LORE v1,00/23](https://lore.kernel.org/all/20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com)
*-*-*-*-*-*-*-*
[LORE v2,00/22](https://lore.kernel.org/all/20221128132100.30253-1-ricardo.neri-calderon@linux.intel.com)
*-*-*-*-*-*-*-*
[LORE v3,0/24](https://lore.kernel.org/all/20230207051105.11575-1-ricardo.neri-calderon@linux.intel.com)
*-*-*-*-*-*-*-*
[LORE v4,00/24](https://lore.kernel.org/all/20230613042422.5344-1-ricardo.neri-calderon@linux.intel.com) | | 2024/01/31 | Stanislaw Gruszka | [thermal/netlink/intel_hfi: Enable HFI feature only when required](https://lore.kernel.org/all/20240131120535.933424-1-stanislaw.gruszka@linux.intel.com) | 该补丁集仅在有用户空间实体侦听热网络链接事件时才启用 HFI. 引入了一个 netlink 通知, 它与 netlink_has_listners()检查一起, 允许驱动程序根据实际用户空间消费者的存在发送 netlink 多播事件. 此功能通过允许在不需要时禁用功能来优化资源使用. 然后在 intel_hif 驱动程序中实现通知机制, 用于动态禁用硬件反馈接口 (HFI). 通过实现 netlink 通知回调, 驱动程序现在可以根据实际需求启用或禁用 HFI, 特别是当用户空间应用程序(如英特尔速度选择或英特尔低功耗守护进程) 利用与性能和能效功能相关的事件时. 在有 Intel HFI 但没有安装用户空间组件的机器上, 我们可以节省大量的 CPU 周期. | v1 ☐☑✓ | [LORE v1,0/3](https://lore.kernel.org/all/20240131120535.933424-1-stanislaw.gruszka@linux.intel.com) | | 2024/02/02 | Ricardo Neri | [thermal: intel: hfi: Prework for the virtualization of HFI](https://lore.kernel.org/all/20240203040515.23947-1-ricardo.neri-calderon@linux.intel.com) | 用于 [支持 IPC 类任务的调度](https://lore.kernel.org/all/20230613042422.5344-1-ricardo.neri-calderon@linux.intel.com) 的基础
1. 重新组织 HFI 驱动程序的部分, 以便于实现虚拟 HFI 表.
2. 引入了 ITD 类的概念并启用了 ITD.
3. 增加了对重置当前任务的 ITD 分类历史的支持, 以便在上下文切换期间使用. HFI 的虚拟化要求在系统中无条件启用 HFI 和 ITD. 这与 Stanislaw 的补丁集 [thermal/netlink/intel_hfi: Enable HFI feature only when required](https://lore.kernel.org/all/20240131120535.933424-1-stanislaw.gruszka@linux.intel.com) 存在冲突. | v1 ☐☑✓ | [LORE v1,0/9](https://lore.kernel.org/all/20240203040515.23947-1-ricardo.neri-calderon@linux.intel.com) | -| 2024/02/23 | Stanislaw Gruszka | [thermal/netlink/intel_hfi: Enable HFI feature only when required](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=b33f3d2677b8ddd7a3aba2b02497422a1d2c2a01) | 英特尔 HFI 驱动程序可以在需要时启用它, 从而"节省大量 CPU 周期". 仅在有用户空间使用者处于活动状态时启用它. 如果英特尔 Speed Select 或英特尔低功耗守护程序正在运行, 英特尔 HFI 接口将被激活, 但如果不是, 它将被禁用, 从而显然可以节省大量 CPU 资源. 参见 phoronix 报道 [英特尔 HFI 驱动程序可以“节省大量 CPU 周期”,只需在需要时才启用自身](https://www.phoronix.com/news/Intel-HFI-Enable-Disable) 以及 [](https://www.phoronix.com/news/Intel-HFI-Efficient-Linux-6.10) | v4 ☐☑✓ v6.10-rc1 | [LORE v4,0/3](https://lore.kernel.org/all/20240223155942.60813-1-stanislaw.gruszka@linux.intel.com) | +| 2024/02/23 | Stanislaw Gruszka | [thermal/netlink/intel_hfi: Enable HFI feature only when required](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=b33f3d2677b8ddd7a3aba2b02497422a1d2c2a01) | 英特尔 HFI 驱动程序可以在需要时启用它, 从而 "节省大量 CPU 周期". 仅在有用户空间使用者处于活动状态时启用它. 如果英特尔 Speed Select 或英特尔低功耗守护程序正在运行, 英特尔 HFI 接口将被激活, 但如果不是, 它将被禁用, 从而显然可以节省大量 CPU 资源. 参见 phoronix 报道 [英特尔 HFI 驱动程序可以“节省大量 CPU 周期”,只需在需要时才启用自身](https://www.phoronix.com/news/Intel-HFI-Enable-Disable) 以及 [](https://www.phoronix.com/news/Intel-HFI-Efficient-Linux-6.10) | v4 ☐☑✓ v6.10-rc1 | [LORE v4,0/3](https://lore.kernel.org/all/20240223155942.60813-1-stanislaw.gruszka@linux.intel.com) | @@ -307,7 +307,7 @@ hfi_update_work_fn 英特尔低功耗模式守护程序 LPMD, 用于优化 Linux 下现代酷睿混合 CPU 的主动空闲电源, 这些 CPU 具有 E 和 P 内核的组合. Intel LPMD 支持多种低功耗状态, 可以根据 EPP/EPB/ITMT 设置、IRQ 迁移和任务迁移定义多种状态. 还可以根据不同的利用率阈值选择不同的低功耗状态. 根据检测到的 CPU 拓扑或用户配置文件选择最节能的 CPU. 根据系统利用率等信息, 将在适用时将系统置于低功耗模式, 比如使用最节能的 E 核, 并在不需要时禁用 P 的内核. -2024/06/12 LPMD 发布 0.0.4, 增强了其硬件反馈接口(HFI)监视器, 支持对来自被禁止的 CPU 的提示进行 HFI 监视, 支持多种低功耗状态, 支持工作负载类型提示, 并支持在低功耗模式转换期间更改能效偏好(EPP). 参见 ) +2024/06/12 LPMD 发布 0.0.4, 增强了其硬件反馈接口 (HFI) 监视器, 支持对来自被禁止的 CPU 的提示进行 HFI 监视, 支持多种低功耗状态, 支持工作负载类型提示, 并支持在低功耗模式转换期间更改能效偏好(EPP). 参见 ) 报道 [Intel Low Power Mode Daemon v0.0.4 Released To Optimize Hybrid CPUs On Linux](https://www.phoronix.com/news/Intel-LPMD-Low-Power-0.0.4). @@ -354,7 +354,8 @@ AMD 关于大小核的专利 [US20210173715A1: METHOD OF TASK TRANSITION BETWEEN | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:---:|:----:|:---:|:----:|:---------:|:----:| -| 2024/05/07 | Perry Yuan | [AMD Pstate Driver Fixes and Improvements](https://lore.kernel.org/all/cover.1715065568.git.perry.yuan@amd.com) | 参见 phoronix 报道 [AMD Posts Patches For Improving Heterogeneous Core Type CPUs On Linux](https://www.phoronix.com/news/AMD-Heterogeneous-P-State-Linux) 和 [AMD P-State Linux Patches Updated For Heterogeneous CPUs](https://www.phoronix.com/news/AMD-P-State-Hetero-v3). | v1 ☐☑✓ | [2024/05/07, LORE v1,0/11](https://lore.kernel.org/all/cover.1715065568.git.perry.yuan@amd.com)
*-*-*-*-*-*-*-*
[2024/06/11, LORE v3,0/10](https://lore.kernel.org/all/cover.1718095377.git.perry.yuan@amd.com) | +| 2024/05/07 | Perry Yuan | [AMD Pstate Driver Fixes and Improvements](https://lore.kernel.org/all/cover.1715065568.git.perry.yuan@amd.com) | 参见 phoronix 报道 [AMD Posts Patches For Improving Heterogeneous Core Type CPUs On Linux](https://www.phoronix.com/news/AMD-Heterogeneous-P-State-Linux) 和 [AMD P-State Linux Patches Updated For Heterogeneous CPUs](https://www.phoronix.com/news/AMD-P-State-Hetero-v3), [Testing The AMD Heterogeneous Core Topology Linux Patches On Ryzen AI 300 Series](https://www.phoronix.com/news/Ryzen-AI-Heterogeneous-Core-Top). | v1 ☐☑✓ | [2024/05/07, LORE v1,0/11](https://lore.kernel.org/all/cover.1715065568.git.perry.yuan@amd.com)
*-*-*-*-*-*-*-*
[2024/06/11, LORE v3,0/10](https://lore.kernel.org/all/cover.1718095377.git.perry.yuan@amd.com) | + ### 1.4.3 ARM big.LITTLE & DynamIQ ------- @@ -468,7 +469,7 @@ SGX 旨在以硬件安全为强制性保障, 不依赖于固件和软件的安 | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:----:|:----:|:---:|:----:|:---------:|:----:| | 2021/11/10 | Brijesh Singh | [Add AMD Secure Nested Paging (SEV-SNP) Guest Support](https://patchwork.kernel.org/project/linux-mm/cover/20211110220731.2396491-1-brijesh.singh@amd.com) | Guest 支持 AMD SEV SNP. | v7 ☐ | [Patchwork v7,00/45](https://patchwork.kernel.org/project/linux-mm/cover/20211110220731.2396491-1-brijesh.singh@amd.com)
*-*-*-*-*-*-*-*
[LORE v13,00/26](https://lore.kernel.org/lkml/20240418194133.1452059-1-michael.roth@amd.com) | -| 2024/06/05 | Tom Lendacky | [Provide SEV-SNP support for running under an SVSM](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=99ef9f59847cab1f9091cd4b9d7efbee0ae4fc86) | 这个补丁集的主要目标是为 Linux 提供在 Secure Virtualization Service Module(SVSM)下运行的支持, 使得 Linux 可以在较低的虚拟机特权级别 (VMPL) 上执行.
通过在较低的 VMPL 上运行 Linux, SVSM 可以被用作提供服务的角色, 例如虚拟 TPM(Trusted Platform Module), 这些服务可以为 SEV-SNP Confidential VM(CVM)内的 Linux 提供, 而不必信任来自 Hypervisor 的服务. SEV-SNP 是 AMD 的一种安全虚拟化技术, 它提供了隔离和保护虚拟机的能力.
目前, Linux 客人通常期望在最高的 VMPL(即 VMPL0)运行, 但某些 SEV-SNP 相关的操作需要这个最高权限级别的 VMPL. 特别地, PVALIDATE 指令和 RMPADJUST 指令在设置页面的 VMSA 属性时需要 VMPL0 的权限(在启动 APs 时使用).
如果 Linux 要在一个较低的 VMPL(例如 VMPL2)上运行, 那么它必须通过一个运行在 VMPL0 上的 SVSM 来进行那些它不再能自己执行的操作. Linux 与 SVSM 的交互和使用方式在 SVSM 规范 [1] 和 GHCB(Guest Handle Callback)规范 [2] 中有详细记录. 这个补丁系列引入了在 SVSM 下运行 Linux 的支持, 主要包括以下几方面:
1. 检测 SVSM 的存在, 当不在 VMPL0 运行时, 调用 SVSM 来执行那些受限于当前 VMPL 的页面操作
2. 引入了对 GHCB 的支持, 允许在非 VMPL0 的 VM 中执行 RMPADJUST 和 PVALIDATE 指令
3. 改进了对 AP 启动的支持
4. 更新了对 SEV-SNP 初始化序列的处理
5. 改进了对 VMSA 和 SEV-SNP 安全性的支持
这个补丁系列涉及了对内核中多个模块的修改, 以确保 Linux 能够安全地在 SVSM 环境下运行, 并充分利用 SEV-SNP 提供的安全特性. 补丁系列还包含对配置选项的更新, 以及对用户空间 API 的改进, 以方便用户空间应用能够识别和利用 SVSM 的存在. [AMD Advances Confidential Computing In Linux 6.11 With SEV-SNP + SVSM Guest Support](https://www.phoronix.com/news/AMD-SEV-SNP-SVSM-Linux-6.11) | v5 ☐☑✓ v6.1-rc1 | [LORE v5,0/13](https://lore.kernel.org/all/cover.1717600736.git.thomas.lendacky@amd.com) | +| 2024/06/05 | Tom Lendacky | [Provide SEV-SNP support for running under an SVSM](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=99ef9f59847cab1f9091cd4b9d7efbee0ae4fc86) | 这个补丁集的主要目标是为 Linux 提供在 Secure Virtualization Service Module(SVSM)下运行的支持, 使得 Linux 可以在较低的虚拟机特权级别 (VMPL) 上执行.
通过在较低的 VMPL 上运行 Linux, SVSM 可以被用作提供服务的角色, 例如虚拟 TPM(Trusted Platform Module), 这些服务可以为 SEV-SNP Confidential VM(CVM)内的 Linux 提供, 而不必信任来自 Hypervisor 的服务. SEV-SNP 是 AMD 的一种安全虚拟化技术, 它提供了隔离和保护虚拟机的能力.
目前, Linux 客人通常期望在最高的 VMPL(即 VMPL0)运行, 但某些 SEV-SNP 相关的操作需要这个最高权限级别的 VMPL. 特别地, PVALIDATE 指令和 RMPADJUST 指令在设置页面的 VMSA 属性时需要 VMPL0 的权限 (在启动 APs 时使用).
如果 Linux 要在一个较低的 VMPL(例如 VMPL2) 上运行, 那么它必须通过一个运行在 VMPL0 上的 SVSM 来进行那些它不再能自己执行的操作. Linux 与 SVSM 的交互和使用方式在 SVSM 规范 [1] 和 GHCB(Guest Handle Callback)规范 [2] 中有详细记录. 这个补丁系列引入了在 SVSM 下运行 Linux 的支持, 主要包括以下几方面:
1. 检测 SVSM 的存在, 当不在 VMPL0 运行时, 调用 SVSM 来执行那些受限于当前 VMPL 的页面操作
2. 引入了对 GHCB 的支持, 允许在非 VMPL0 的 VM 中执行 RMPADJUST 和 PVALIDATE 指令
3. 改进了对 AP 启动的支持
4. 更新了对 SEV-SNP 初始化序列的处理
5. 改进了对 VMSA 和 SEV-SNP 安全性的支持
这个补丁系列涉及了对内核中多个模块的修改, 以确保 Linux 能够安全地在 SVSM 环境下运行, 并充分利用 SEV-SNP 提供的安全特性. 补丁系列还包含对配置选项的更新, 以及对用户空间 API 的改进, 以方便用户空间应用能够识别和利用 SVSM 的存在. [AMD Advances Confidential Computing In Linux 6.11 With SEV-SNP + SVSM Guest Support](https://www.phoronix.com/news/AMD-SEV-SNP-SVSM-Linux-6.11) | v5 ☐☑✓ v6.1-rc1 | [LORE v5,0/13](https://lore.kernel.org/all/cover.1717600736.git.thomas.lendacky@amd.com) | | 2022/09/29 | Quan Nguyen | [Add Ampere's Altra SMPro MFD and its child drivers](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=4e6104b1e70020ad500f0fab7238898dd2ea2a38) | [Hardware Monitoring Driver Updates Land In Linux 6.2](https://www.phoronix.com/news/Linux-6.2-HWMON) 和 [Hardware Monitoring Improvements Submitted For Linux 6.11](https://www.phoronix.com/news/Linux-6.11-HWMON). | v9 ☐☑✓ 6.2 | [LORE v9,0/9](https://lore.kernel.org/all/20220929094321.770125-1-quan@os.amperecomputing.com) | ## 1.9 Software Defined Silicon @@ -507,7 +508,7 @@ SGX 旨在以硬件安全为强制性保障, 不依赖于固件和软件的安 | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:---:|:----:|:---:|:----:|:---------:|:----:| -| 2024/04/24 | Tony Luck | [New Intel CPUID families](https://lore.kernel.org/all/20240424181245.41141-1-tony.luck@intel.com) | 自 90 年代中期以来, 英特尔工程师一直在使用 P6 微架构的 "Family 6" 后, 重新设计了 Linux 的英特尔 CPU 模型处理, 并继续仅在新的微架构中修改模型 ID. 这是 Family 6 时代的终结, 因此有很多 Linux 补丁正在开发中, 以解决内核代码中的假设, 这些假设只检查 Intel CPU 的型号 ID, 而不是任何系列 ID 差异. 参见 phoronix 报道 [Rework For Intel CPU Model Handling To Land With Linux 6.10](https://www.phoronix.com/news/Intel-CPU-Models-Linux-6.10) 以及 [Intel "Family 6" CPU Era Coming To An End Soon: Code Suggests Cooper Forest & Adams Lake](https://lore.kernel.org/all/20240424181245.41141-1-tony.luck@intel.com). | v4 ☐☑✓ | [LORE v4,0/71](https://lore.kernel.org/all/20240424181245.41141-1-tony.luck@intel.com) | +| 2024/04/24 | Tony Luck | [New Intel CPUID families](https://lore.kernel.org/all/20240424181245.41141-1-tony.luck@intel.com) | 自 90 年代中期以来, 英特尔工程师一直在使用 P6 微架构的 "Family 6" 后, 重新设计了 Linux 的英特尔 CPU 模型处理, 并继续仅在新的微架构中修改模型 ID. 这是 Family 6 时代的终结, 因此有很多 Linux 补丁正在开发中, 以解决内核代码中的假设, 这些假设只检查 Intel CPU 的型号 ID, 而不是任何系列 ID 差异. 参见 phoronix 报道 [Rework For Intel CPU Model Handling To Land With Linux 6.10](https://www.phoronix.com/news/Intel-CPU-Models-Linux-6.10) 以及 [Intel"Family 6"CPU Era Coming To An End Soon: Code Suggests Cooper Forest & Adams Lake](https://lore.kernel.org/all/20240424181245.41141-1-tony.luck@intel.com). | v4 ☐☑✓ | [LORE v4,0/71](https://lore.kernel.org/all/20240424181245.41141-1-tony.luck@intel.com) | @@ -734,7 +735,7 @@ TLB entry shootdown 常常或多或少的带来一些性能问题. | 2019/01/31 | Julien Thierry | [arm64: provide pseudo NMI with GICv3](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1548946743-38979-1-git-send-email-julien.thierry@arm.com) | ARM64 通过中断优先级实现(伪)NMI | v10 ☑ [5.1-rc1](https://kernelnewbies.org/Linux_5.1#ARM) | [Patchwork v10,00/25](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1548946743-38979-1-git-send-email-julien.thierry@arm.com), [关键 commit](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc3c03ccb4641fb940b27a0d369431876923a8fe) | | 2019/06/11 | Julien Thierry | [arm64: IRQ priority masking and Pseudo-NMI fixes](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1560245893-46998-1-git-send-email-julien.thierry@arm.com) | 修复伪 NMI 的诸多问题 | v4 ☑ 5.10-rc1 | [Patchwork v4,0/8](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1560245893-46998-1-git-send-email-julien.thierry@arm.com) | | 2019/07/17 | Julien Thierry | [arm_pmu: Use NMI for perf interrupt](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1563351432-55652-1-git-send-email-julien.thierry@arm.com) | ARM64 perf 的中断通过伪 NMI 上报, 这样会使 perf 的热点采样更加精准. | v4 ☑ 5.10-rc1 | [Patchwork v4,0/9](https://patchwork.kernel.org/project/linux-arm-kernel/cover/1563351432-55652-1-git-send-email-julien.thierry@arm.com) | -| 2024/04/03 | Jinjie Ruan via | [target/arm: Implement FEAT_NMI and FEAT_GICv3_NMI](https://lore.kernel.org/all/20240403101611.3204086-1-ruanjinjie@huawei.com) | 这个补丁集为 ARMv8 的 FEAT_NMI 和 FEAT_GICv3_NMI, 引入了对体系结构中一类新中断的支持, 可以使用它来提供类似NMI的功能. | v3 ☐☑✓ | [LORE v3,0/23](https://lore.kernel.org/all/20240403101611.3204086-1-ruanjinjie@huawei.com) | +| 2024/04/03 | Jinjie Ruan via | [target/arm: Implement FEAT_NMI and FEAT_GICv3_NMI](https://lore.kernel.org/all/20240403101611.3204086-1-ruanjinjie@huawei.com) | 这个补丁集为 ARMv8 的 FEAT_NMI 和 FEAT_GICv3_NMI, 引入了对体系结构中一类新中断的支持, 可以使用它来提供类似 NMI 的功能. | v3 ☐☑✓ | [LORE v3,0/23](https://lore.kernel.org/all/20240403101611.3204086-1-ruanjinjie@huawei.com) | | 2024/04/15 | Liao Chang | [Rework the DAIF mask, unmask and track API](https://lore.kernel.org/all/20240415064758.3250209-1-liaochang1@huawei.com) | TODO | v3 ☐☑✓ | [LORE v2,0/9](https://lore.kernel.org/all/20240411064858.3232574-1-liaochang1@huawei.com)
*-*-*-*-*-*-*-*
[LORE v3,0/8](https://lore.kernel.org/all/20240415064758.3250209-1-liaochang1@huawei.com) | @@ -850,7 +851,7 @@ ARM v8.2 引入了 [UAO](https://community.arm.com/arm-community-blogs/b/archite |:-----:|:----:|:----:|:----:|:------------:|:----:| | 2022/05/04 | Hector Martin | [Apple SoC cpufreq driver](https://patchwork.kernel.org/project/linux-arm-kernel/cover/20220504075153.185208-1-marcan@marcan.st/) | 638189 | v2 ☐☑ | [LORE v2,0/4](https://lore.kernel.org/r/20220504075153.185208-1-marcan@marcan.st) | -Apple Silicon 不支持像插入 U 盘并重新启动到 Linux 安装程序这样简单的事情. 想要在 M1 或更高版本的 Mac 上安装 Linux 的用户必须在 macOS 中开始安装, 调整磁盘大小以便有空间容纳 Asahi, 然后重新启动到 macOS 恢复 (recoveryOS) 以完成安装. Asahi Linux 通常与 macOS 一起安装, 因此用户可以选择启动到任一操作系统, 但用户可以完全摆脱 macOS 分区. 作为该过程的一部分, Asahi 将用于系统恢复的 macOS 内核替换为 Asahi 的 m1n1 引导加载程序, 用于 Apple 硬件. 这意味着安装程序(用 Python 编写)需要两个 macOS 二进制文件来执行安装: macOS 的 Python 解释器和 libffi, recoveryOS 中的 Python 使用它从 macOS 内核中提取固件供 Linux 使用. 不幸的是, 它需要 Xcode 为 macOS 构建这些二进制文件, 因此不可能在 Linux 上构建二进制文件, 这意味着要发布预构建的二进制文件. 这方面 Fedora 已经批准了这些二进制程序的构建于发布. 参见 [LWN, 2024/05/29, FESCo-2024, Fedora approves shipping pre-built macOS binaries](https://lwn.net/Articles/975445). +Apple Silicon 不支持像插入 U 盘并重新启动到 Linux 安装程序这样简单的事情. 想要在 M1 或更高版本的 Mac 上安装 Linux 的用户必须在 macOS 中开始安装, 调整磁盘大小以便有空间容纳 Asahi, 然后重新启动到 macOS 恢复 (recoveryOS) 以完成安装. Asahi Linux 通常与 macOS 一起安装, 因此用户可以选择启动到任一操作系统, 但用户可以完全摆脱 macOS 分区. 作为该过程的一部分, Asahi 将用于系统恢复的 macOS 内核替换为 Asahi 的 m1n1 引导加载程序, 用于 Apple 硬件. 这意味着安装程序 (用 Python 编写) 需要两个 macOS 二进制文件来执行安装: macOS 的 Python 解释器和 libffi, recoveryOS 中的 Python 使用它从 macOS 内核中提取固件供 Linux 使用. 不幸的是, 它需要 Xcode 为 macOS 构建这些二进制文件, 因此不可能在 Linux 上构建二进制文件, 这意味着要发布预构建的二进制文件. 这方面 Fedora 已经批准了这些二进制程序的构建于发布. 参见 [LWN, 2024/05/29, FESCo-2024, Fedora approves shipping pre-built macOS binaries](https://lwn.net/Articles/975445). ## 2.8 clocksource ------- @@ -906,14 +907,14 @@ SLS 被认为是 Spectre 漏洞的变体, 但二者的攻击范围略有不同, ## 4.3 branch history injection ------- -[The "branch history injection" hardware vulnerability](https://lwn.net/Articles/969210) +[The"branch history injection"hardware vulnerability](https://lwn.net/Articles/969210) -[Linux Kernel Patched For Branch History Injection "BHI" Intel CPU Vulnerability](https://www.phoronix.com/news/Linux-BHI-Branch-History-Inject) +[Linux Kernel Patched For Branch History Injection"BHI"Intel CPU Vulnerability](https://www.phoronix.com/news/Linux-BHI-Branch-History-Inject) | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:-----:|:----:|:----:|:----:|:------------:|:----:| -| 2024/04/05 | Josh Poimboeuf | [x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=2bb69f5fc72183e1c62547d900f560d0e9334925) | TODO | v2 ☐☑✓ | [LORE](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bb69f5fc72183e1c62547d900f560d0e9334925) | +| 2024/04/05 | Josh Poimboeuf | [x86/bugs: Change commas to semicolons in'spectre_v2'sysfs file](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=2bb69f5fc72183e1c62547d900f560d0e9334925) | TODO | v2 ☐☑✓ | [LORE](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bb69f5fc72183e1c62547d900f560d0e9334925) | | 2024/04/19 | Josh Poimboeuf | [x86/bugs: more BHI fixes](https://lore.kernel.org/all/cover.1713559768.git.jpoimboe@kernel.org) | [Linux BHI Mitigation Being Tweaked Following 12% Database Performance Hit](https://www.phoronix.com/news/Linux-BHI-Fix-Server-Perf). | v1 ☐☑✓ | [LORE v1,0/5](https://lore.kernel.org/all/cover.1713559768.git.jpoimboe@kernel.org) | @@ -1130,7 +1131,7 @@ https://blogs.vmware.com/vsphere/2021/10/introducing-project-capitola.html | 编号 | 作者 | 工具 | 描述 | 链接 | |:---:|:-----:|:----:|:---:|:----: | 1 | paulmckrcu | [litmus](https://github.com/paulmckrcu/litmus) | Automatically generated litmus tests for validation LISA-language Linux-kernel memory models | [github/paulmckrcu/litmus](https://github.com/paulmckrcu/litmus) | -| 2 | herd | [herd/herdtools7](https://github.com/herd/herdtools7) | 一个用于测试弱内存模型的工具套件. HERD7: 用于弱内存模型的通用模拟器, litmus7: 运行 litmus 测试(作为 Power、ARM、AArch64 或 X86 的汇编程序提供)来测试执行机器的内存模型, DIY7: 根据简明规范制作石蕊测试 | [官网](http://diy.inria.fr) | +| 2 | herd | [herd/herdtools7](https://github.com/herd/herdtools7) | 一个用于测试弱内存模型的工具套件. HERD7: 用于弱内存模型的通用模拟器, litmus7: 运行 litmus 测试 (作为 Power、ARM、AArch64 或 X86 的汇编程序提供) 来测试执行机器的内存模型, DIY7: 根据简明规范制作石蕊测试 | [官网](http://diy.inria.fr) | | 3 | Hernan Ponce de Leon 等 | [Dat3M](https://github.com/hernanponcedeleon/Dat3M) | Memory Model Aware Verification, Dartagnan is a tool to check state reachability under weak memory models. | [github/hernanponcedeleon/Dat3M](https://github.com/hernanponcedeleon/Dat3M) | | 4 | MPI-SWS(Max Planck Institute for Software Systems) | [GenMC](https://github.com/MPI-SWS/genmc) | A Model Checker for Weak Memory Models | [官网](https://plv.mpi-sws.org/genmc), [论文引用详情](https://ouci.dntb.gov.ua/en/works/4ryroeM7), [github/MPI-SWS/genmc](https://github.com/MPI-SWS/genmc) | | 5 | MPI-SWS(Max Planck Institute for Software Systems) | [Kater](https://github.com/MPI-SWS/kater) | Automating Weak Memory Model Metatheory and Consistency Checking | [MPI-SWS/kater](https://github.com/MPI-SWS/kater) | @@ -1164,7 +1165,7 @@ Rosetta 是一个转译过程, 允许用户在 Apple Silicon 上运行包含 x86 [FEX](https://fex-emu.com) 是在 ARM64/AArch64 Linux 上开发用户模式 x86/x86_64 二进制仿真的开源项目之一. -[FEX 2406](https://fex-emu.com/FEX-2406) 于 2024/6/13 发布新版本, 附带了许多[即时 JIT 优化](https://fex-emu.com/FEX-2406)、大大改进的寄存器分配器以及各种其他性能优化, 带来了 2% 到 12% 的性能提升. FEX 2406 还增加了对 32 位 OpenGL thunking 的支持, 作为提高其 x86 32 位游戏/应用程序兼容性的一部分. [FEX 2406 Brings JIT Optimizations For Running x86_64 Binaries On AArch64](https://www.phoronix.com/news/FEX-2406-Released). +[FEX 2406](https://fex-emu.com/FEX-2406) 于 2024/6/13 发布新版本, 附带了许多[即时 JIT 优化](https://fex-emu.com/FEX-2406)、大大改进的寄存器分配器以及各种其他性能优化, 带来了 2% 到 12% 的性能提升. FEX 2406 还增加了对 32 位 OpenGL thunking 的支持, 作为提高其 x86 32 位游戏 / 应用程序兼容性的一部分. [FEX 2406 Brings JIT Optimizations For Running x86_64 Binaries On AArch64](https://www.phoronix.com/news/FEX-2406-Released). [FEX 2407](https://fex-emu.com/FEX-2406) 于 2024/07/04 发布, 实现了 AVX/AVX2 的支持. 为了在 ARM 上实现高效的 AVX 仿真, 需要 256 位 SVE. 对于其他硬件, 256 位指令被分解为两个 128 位指令. 这条路径不太理想, 但至少允许支持 AVX 的软件运行. 参见 phoronix 报道 [FEX 2407 Emulator For x86_64 Binaries On ARM Now Handles AVX/AVX2](https://www.phoronix.com/news/FEX-Emulator-2407). @@ -1289,7 +1290,7 @@ openEuler 提供了 [openEuler/prefetch_tuning](https://gitee.com/openeuler/pref | 2022/03/25 | Mario Limonciello | [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)
*-*-*-*-*-*-*-*
[LORE v3,0/6](https://lore.kernel.org/linux-pm/20220414164801.1051-1-mario.limonciello@amd.com) | | 2023/01/13 | Wyes Karny | [amd_pstate: Add guided autonomous mode support](https://lore.kernel.org/all/20230113052141.2874296-1-wyes.karny@amd.com) | [AMD Updates P-State"Guided Autonomous Mode"Support For Linux](https://www.phoronix.com/news/AMD-Guided-Auto-Mode-v2) | v2 ☐☑✓ | [LORE v2,0/6](https://lore.kernel.org/all/20230113052141.2874296-1-wyes.karny@amd.com) | | 2024/01/30 | Perry Yuan | [enable x86_energy_perf_policy for AMD CPU](https://lore.kernel.org/all/cover.1706583551.git.perry.yuan@amd.com) | 对 AMD 处理器上 x86_energy_perf_policy 实用程序的支持, 这些处理器使用 CPPC(Collaborative Processor Performance Control) 接口进行频率缩放, 并使用 AMD_state 驱动程序模块. AMD 处理器已经支持各种能源性能偏好 EPP(Energy Performance Preference) 配置文件. 有了这个实用程序, 用户现在可以使用提供的命令在这些 EPP 配置文件之间无缝切换. 并使用此工具检查 CPPC 的功能. 此增强旨在提高 AMD 处理器的电源效率和性能管理, 为用户提供对系统能源性能行为的更多控制. 参见 [Linux's x86_energy_perf_policy Utility Being Extended To AMD CPUs](https://www.phoronix.com/news/AMD-x86_energy_perf_policy) | v1 ☐☑✓ | [LORE v1,0/8](https://lore.kernel.org/all/cover.1706583551.git.perry.yuan@amd.com) | -| 2024/04/28 | Xiaojian Du | [x86/cpufeatures: Add AMD FAST CPPC feature flag](https://lore.kernel.org/all/20240428091133.592333-1-Xiaojian.Du@amd.com) | 一些 AMD Zen 4 处理器支持新功能 FAST CPPC, 由于内部架构增强, 该功能允许更快的 CPPC 循环. 这种更快循环的目标是在相同的功耗下获得更高的性能. 参见 phoronix 报道 [AMD Enabling "Fast CPPC" For Even Greater Linux Performance & Power Efficiency On Some CPUs](https://www.phoronix.com/news/AMD-Fast-CPPC-Linux-Patches). | v1 ☐☑✓ | [LORE v1,0/2](https://lore.kernel.org/all/20240428091133.592333-1-Xiaojian.Du@amd.com)
*-*-*-*-*-*-*-*
[LORE v4,1/2](https://lore.kernel.org/linux-pm/e717feea3df0a178a9951491040a76c79a00556c.1716649578.git.Xiaojian.Du@amd.com) | +| 2024/04/28 | Xiaojian Du | [x86/cpufeatures: Add AMD FAST CPPC feature flag](https://lore.kernel.org/all/20240428091133.592333-1-Xiaojian.Du@amd.com) | 一些 AMD Zen 4 处理器支持新功能 FAST CPPC, 由于内部架构增强, 该功能允许更快的 CPPC 循环. 这种更快循环的目标是在相同的功耗下获得更高的性能. 参见 phoronix 报道 [AMD Enabling"Fast CPPC"For Even Greater Linux Performance & Power Efficiency On Some CPUs](https://www.phoronix.com/news/AMD-Fast-CPPC-Linux-Patches). | v1 ☐☑✓ | [LORE v1,0/2](https://lore.kernel.org/all/20240428091133.592333-1-Xiaojian.Du@amd.com)
*-*-*-*-*-*-*-*
[LORE v4,1/2](https://lore.kernel.org/linux-pm/e717feea3df0a178a9951491040a76c79a00556c.1716649578.git.Xiaojian.Du@amd.com) | #### 6.12.2.2 AMD P-State Preferred Core @@ -1339,7 +1340,7 @@ AMD-pstate 驱动程序利用 ITMT 体系结构提供的功能和数据结构, | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:---:|:----:|:---:|:----:|:---------:|:----:| -| 2023/08/29 | Tony Luck | [Add support for Sub-NUMA cluster (SNC) systems](https://lore.kernel.org/all/20230829234426.64421-1-tony.luck@intel.com) | Add support for Sub-NUMA cluster (SNC) systems](https://lore.kernel.org/all/20240528222006.58283-1-tony.luck@intel.com) | 英特尔推出了一个大型的 Linux 内核补丁系列, 以改进 Sub-NUMA 集群 "SNC" 支持, 使其在现代英特尔硬件上与英特尔资源总监技术(RDT) 配合良好. SNC 将 CPU 内核/缓存/内存拆分为多个 NUMA 域有助于提高 NUMA 感知工作负载的性能. 参见 phoronix 报道 [Intel Fixing Up Sub-NUMA Clustering For Linux So That It Behaves With RDT](https://www.phoronix.com/news/Intel-SNT-RDT-Fixing-Up) 和 [Intel Sub-NUMA Clustering Will Stop Clashing With Resource Director On Linux 6.11+](https://www.phoronix.com/news/Intel-SNC-RDT-Behaves-Linux-611). | v5 ☐☑✓ | [LORE v5,0/8](https://lore.kernel.org/all/20230829234426.64421-1-tony.luck@intel.com)
*-*-*-*-*-*-*-*
[LORE v19,0/20](https://lore.kernel.org/all/20240528222006.58283-1-tony.luck@intel.com) | +| 2023/08/29 | Tony Luck | [Add support for Sub-NUMA cluster (SNC) systems](https://lore.kernel.org/all/20230829234426.64421-1-tony.luck@intel.com) | Add support for Sub-NUMA cluster (SNC) systems](https://lore.kernel.org/all/20240528222006.58283-1-tony.luck@intel.com) | 英特尔推出了一个大型的 Linux 内核补丁系列, 以改进 Sub-NUMA 集群 "SNC" 支持, 使其在现代英特尔硬件上与英特尔资源总监技术(RDT) 配合良好. SNC 将 CPU 内核 / 缓存 / 内存拆分为多个 NUMA 域有助于提高 NUMA 感知工作负载的性能. 参见 phoronix 报道 [Intel Fixing Up Sub-NUMA Clustering For Linux So That It Behaves With RDT](https://www.phoronix.com/news/Intel-SNT-RDT-Fixing-Up) 和 [Intel Sub-NUMA Clustering Will Stop Clashing With Resource Director On Linux 6.11+](https://www.phoronix.com/news/Intel-SNC-RDT-Behaves-Linux-611). | v5 ☐☑✓ | [LORE v5,0/8](https://lore.kernel.org/all/20230829234426.64421-1-tony.luck@intel.com)
*-*-*-*-*-*-*-*
[LORE v19,0/20](https://lore.kernel.org/all/20240528222006.58283-1-tony.luck@intel.com) | | 2023/12/07 | Tony Luck | [x86/resctrl: mba_MBps enhancements](https://lore.kernel.org/all/20231207195613.153980-1-tony.luck@intel.com) | TODO | v6 ☐☑✓ | [LORE v6,0/3](https://lore.kernel.org/all/20231207195613.153980-1-tony.luck@intel.com) | | 2024/02/13 | James Morse | [x86/resctrl: monitored closid+rmid together, separate arch/fs locking](https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/log/?id=fb700810d30b9eb333a7bf447012e1158e35c62f) | [Improved Memory Bandwidth Throttling Behavior For Linux 6.9](https://www.phoronix.com/news/Linux-69-RAM-Bandwidth-Throttle) | v9 ☐☑✓ 6.9-rc1 | [LORE v9,0/24](https://lore.kernel.org/all/20240213184438.16675-1-james.morse@arm.com) | | 2024/03/21 | James Morse | [x86/resctrl: Move the resctrl filesystem code to /fs/resctrl](https://lore.kernel.org/all/20240321165106.31602-1-james.morse@arm.com) | TODO | v1 ☐☑✓ | [LORE v1,0/31](https://lore.kernel.org/all/20240321165106.31602-1-james.morse@arm.com) | diff --git a/study/kernel/00-DESCRIPTION/DEBUGGING.md b/study/kernel/00-DESCRIPTION/DEBUGGING.md index 1f8bdbc..71212e0 100644 --- a/study/kernel/00-DESCRIPTION/DEBUGGING.md +++ b/study/kernel/00-DESCRIPTION/DEBUGGING.md @@ -249,6 +249,8 @@ $reclaim = current\_mem \times reclaim\_ratio \times max(0,1 – \frac{psi_some} [getrandom() In The vDSO Aims For Linux 6.11 To Provide Faster Yet Secure User-Space RNG](https://www.phoronix.com/news/getrandom-vDSO-RNG-Linux-6.11) +[Glibc Patch Being Reviewed For getrandom vDSO Support](https://www.phoronix.com/news/Glibc-Review-getrandom-vDSO) + ## 8.2 getrandom vDSO ------- @@ -349,7 +351,7 @@ $reclaim = current\_mem \times reclaim\_ratio \times max(0,1 – \frac{psi_some} | 2022/07/25 | Albert Huang | [faster kexec reboot](https://lore.kernel.org/all/20220725083904.56552-1-huangjie.albert@bytedance.com) | TODO | v1 ☐☑✓ | [LORE v1,0/4](https://lore.kernel.org/all/20220725083904.56552-1-huangjie.albert@bytedance.com) | -# 11 perf +# 11 PERF ------- ## 11.1 perf-user @@ -385,10 +387,18 @@ $reclaim = current\_mem \times reclaim\_ratio \times max(0,1 – \frac{psi_some} | 2022/06/16 | Namhyung Kim | [perf/core: Add a new read format to get a number of lost samples](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=119a784c81270eb88e573174ed2209225d646656) | 有时候用户想知道样本的准确数量, 即使存在一定数量的样本丢失. 当因为环缓冲区冲突造成的事件丢失使用 PERF_RECORD_LOST 标记记录, 虽然很难知道每个事件丢失的次数, 但是聊胜于无. 因此定义 PERF_FORMAT_LOST, 通过 event->lost_samples 记录丢失的次数, 以便从用户空间获取到它. | v4 ☑✓ 6.0-rc1 | [LORE](https://lore.kernel.org/all/20220616180623.1358843-1-namhyung@kernel.org) | | 2022/08/16 | Namhyung Kim | [perf tools: Support reading PERF_FORMAT_LOST (v2)](https://lore.kernel.org/all/20220816221747.275828-1-namhyung@kernel.org) | TODO | v2 ☐☑✓ | [LORE 0/4](https://lore.kernel.org/lkml/20220815190106.1293082-1-namhyung@kernel.org)
*-*-*-*-*-*-*-*
[LORE v2,0/4](https://lore.kernel.org/all/20220816221747.275828-1-namhyung@kernel.org) | -## 11.2 ARM SPE +## 11.2 高精度采样 ------- +## 11.2.1 x86 PEBS +------- +| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | +|:----:|:----:|:---:|:----:|:---------:|:----:| +| 2024/07/20 | weilin.wang@intel.com | [TPEBS counting mode support](https://lore.kernel.org/all/20240720062102.444578-1-weilin.wang@intel.com) | 支持 TPEBS 在 perf 计数模式下的使用, TPEBS(Timed Process Event-Based Sampling) 是 Intel 提供的一种处理器机制, 用于在性能分析中更准确地测量事件的退休延迟 (retire latency). 补丁集实现了在 Linux 的 perf 工具中, 当使用 TPEBS 功能时, 可以在计数模式下收集事件的退休延迟值. 关于 TPEBS 参见 [Timed Process Event Based Sampling (TPEBS)](https://www.intel.com/content/www/us/en/developer/articles/technical/timed-process-event-based-sampling-tpebs.html). | v18 ☐☑✓ | [LORE v18,0/8](https://lore.kernel.org/all/20240720062102.444578-1-weilin.wang@intel.com) | + +## 11.2.2 ARM SPE +------- | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:----:|:----:|:---:|:----:|:---------:|:----:| @@ -809,6 +819,9 @@ Mold 链接器中添加了一个新的 "--separate-debug-file" 选项, 以实现 ["CC_OPTIMIZE_FOR_PERFORMANCE_O3" Performance Tunable Dropped In Linux 6.0](https://www.phoronix.com/news/Linux-6.0-Drops-O3-Kconfig) +[Canonical Evaluating -O3 Optimized Packages For Ubuntu Linux](https://www.phoronix.com/news/Ubuntu-Evaluating-O3-Optimized) +[Trying Out The Ubuntu "-O3" Optimized Build For Greater Performance](https://www.phoronix.com/review/ubuntu-o3-experiment) + | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:---:|:----:|:---:|:----:|:---------:|:----:| | 2022/06/21 | Miko Larsson | [Kconfig: -O3 enablement](https://lore.kernel.org/all/20220621133526.29662-1-mikoxyzzz@gmail.com) | 允许所有架构支持 -O3 编译. | v1 ☐☑✓ | [LORE v1,0/2](https://lore.kernel.org/all/20220621133526.29662-1-mikoxyzzz@gmail.com) | @@ -1152,9 +1165,10 @@ Fedora 尝试优化 systemd 开机以及重启的时间, 参见 phoronix 报道 [Arm Helping With AArch64 Rust Linux Kernel Enablement](https://www.phoronix.com/news/AArch64-Rust-Linux-Kernel) - [Linux 6.11 Adds Support For Rust-Based Block Drivers & Atomic Writes](https://www.phoronix.com/news/Linux-6.11-Block-IO_uring) +[An Empirical Study of Rust-for-Linux: The Success, Dissatisfaction, and Compromise](https://www.usenix.org/conference/atc24/presentation/li-hongyu) + | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:---:|:----:|:---:|:----:|:---------:|:----:| | 2022/09/27 | Miguel Ojeda | [Rust support](https://lore.kernel.org/all/20220927131518.30000-1-ojeda@kernel.org) | TODO| v10 ☐☑✓ | [LORE 00/13](https://lore.kernel.org/all/20210414184604.23473-1-ojeda@kernel.org)
*-*-*-*-*-*-*-*
[LORE v10,0/27](https://lore.kernel.org/all/20220927131518.30000-1-ojeda@kernel.org) | @@ -1164,9 +1178,10 @@ Fedora 尝试优化 systemd 开机以及重启的时间, 参见 phoronix 报道 | 2024/05/14 | Wedson Almeida Filho | [Rust abstractions for VFS](https://lore.kernel.org/all/20240514131711.379322-1-wedsonaf@gmail.com) | 参见 phoronix 报道 [Microsoft Engineer Ports EXT2 File-System Driver To Rust](https://www.phoronix.com/news/Rust-VFS-Linux-V2-Now-With-EXT2) 以及 [Rust for filesystems](https://lwn.net/Articles/978738). | v2 ☐☑✓ | [LORE v2,0/30](https://lore.kernel.org/all/20240514131711.379322-1-wedsonaf@gmail.com) | | 2024/05/20 | Danilo Krummrich | [DRM Rust abstractions and Nova](https://lore.kernel.org/all/20240520172059.181256-1-dakr@redhat.com) | [RFC Patches Posted For Rust-Written NVIDIA"Nova"GPU Driver](https://www.phoronix.com/news/RFC-Rust-Nova-NVIDIA-Driver). | v1 ☐☑✓ | [LORE v1,0/8](https://lore.kernel.org/all/20240520172059.181256-1-dakr@redhat.com) | | 2024/07/17 | Benno Lossin | [Introduce the Rust Safety Standard](https://lore.kernel.org/all/20240717221133.459589-1-benno.lossin@proton.me) | [Rust Safety Standard Proposed For The Linux Kernel](https://www.phoronix.com/news/Rust-Safety-Standard-Linux-RFC). | v1 ☐☑✓ | [LORE v1,0/5](https://lore.kernel.org/all/20240717221133.459589-1-benno.lossin@proton.me) | -| 2024/07/01 | Miguel Ojeda | [Support several Rust toolchain versions](https://lore.kernel.org/all/20240701183625.665574-1-ojeda@kernel.org) | -几乎每一个 Linux 内核周期都会引入新的补丁, 这些补丁通常会提升内核支持的 Rust 语言版本, 以便达到一个合适的最低版本要求. Miguel Ojeda 发布的这组组补丁, 旨在使 Rust 内核代码能够支持多个版本的 Rust 编译器("rustc"), 然后只需要指定一个安全的最低 Rust 版本要求. 参见 [The Linux Kernel Matures To Having A Minimum Rust Toolchain Version](https://www.phoronix.com/news/Linux-Patches-Multiple-Rust-Ver). | v1 ☐☑✓ | [LORE v1,0/13](https://lore.kernel.org/all/20240701183625.665574-1-ojeda@kernel.org) | +| 2024/07/01 | Miguel Ojeda | [Support several Rust toolchain versions](https://lore.kernel.org/all/20240701183625.665574-1-ojeda@kernel.org) | 几乎每一个 Linux 内核周期都会引入新的补丁, 这些补丁通常会提升内核支持的 Rust 语言版本, 以便达到一个合适的最低版本要求. Miguel Ojeda 发布的这组组补丁, 旨在使 Rust 内核代码能够支持多个版本的 Rust 编译器("rustc"), 然后只需要指定一个安全的最低 Rust 版本要求. 参见 [The Linux Kernel Matures To Having A Minimum Rust Toolchain Version](https://www.phoronix.com/news/Linux-Patches-Multiple-Rust-Ver). | v1 ☐☑✓ | [LORE v1,0/13](https://lore.kernel.org/all/20240701183625.665574-1-ojeda@kernel.org) | | 2024/07/24 | Miguel Ojeda | [Rust: support `CPU_MITIGATIONS` and enable `objtool`](https://lore.kernel.org/all/20240724161501.1319115-1-ojeda@kernel.org) | 关于在 Rust 内核代码中实现各种 CPU 安全缓解措施的最新补丁, 作为其中的一部分, 同时为 Rust 启用了 objtool 支持. 重点是根据编译器的 Retpolines、Rethunk 和直线推测 (SLS) 处理来传递相关的编译器标志以构建 Rust 代码. 通过这些补丁, 适当的标志将被传递给 Rust 编译器, 以便在需要编译器端操作的安全缓解措施中提供足够的保护. | v2 ☐☑✓ |[LORE v2,0/6](https://lore.kernel.org/all/20240724161501.1319115-1-ojeda@kernel.org) | +几乎每一个 Linux 内核周期都会引入新的补丁, 这些补丁通常会提升内核支持的 Rust 语言版本, 以便达到一个合适的最低版本要求. Miguel Ojeda 发布的这组组补丁, 旨在使 Rust 内核代码能够支持多个版本的 Rust 编译器("rustc"), 然后只需要指定一个安全的最低 Rust 版本要求. 参见 [The Linux Kernel Matures To Having A Minimum Rust Toolchain Version](https://www.phoronix.com/news/Linux-Patches-Multiple-Rust-Ver). | v1 ☐☑✓ | [LORE v1,0/13](https://lore.kernel.org/all/20240701183625.665574-1-ojeda@kernel.org) | +| 2024/08/05 | Danilo Krummrich | [Generic `Allocator` support for Rust](https://lore.kernel.org/all/20240805152004.5039-1-dakr@kernel.org) | 这个补丁系列是关于为 Rust 语言在 Linux 内核中添加通用的内核分配器(Allocator)支持. 以下是补丁系列的主要变更和目的:
1. 添加通用内核分配器支持: 目前主线上, Rust 在 Linux 内核中的内存分配仅限于 kmalloc. 这个补丁系列扩展了这一功能, 允许使用更多的内存分配器以及分配策略.
2. 自定义 Allocator trait: 为了避免向内核添加不稳定的 Rust 特性, 补丁系列没有扩展 Rust 的 alloc crate 中的 Allocator trait, 也没有扩展 BoxExt 和 VecExt 扩展. 而是引入了特定的 Allocator trait, 并由 Kmalloc、Vmalloc 和 KVmalloc 分配器实现, 这些分配器也是在这个系列中实现的.
3. 定义内核专用类型, 移除对 alloc crate 的依赖:: 为了使用新的分配器, 补丁系列添加了自定义的 `Box` 和 `Vec` 类型(其中 A 是特定的分配器), 这些类型依赖于特定的分配器. | v1 ☐☑✓ | [2024/08/05, LORE v4,00/28](https://lore.kernel.org/all/20240805152004.5039-1-dakr@kernel.org) | diff --git a/study/kernel/00-DESCRIPTION/MEMORY_MANAGER.md b/study/kernel/00-DESCRIPTION/MEMORY_MANAGER.md index 17aaa4e..890c70e 100644 --- a/study/kernel/00-DESCRIPTION/MEMORY_MANAGER.md +++ b/study/kernel/00-DESCRIPTION/MEMORY_MANAGER.md @@ -315,6 +315,7 @@ Linux 一开始是在一台 i386 上的机器开发的, i386 的硬件页表是 [Folio Improvements For Linux 5.17, Large Folio Patches Posted](https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.17-Folios) +[LWN, 2024/07/24, Large folios, swap, and FS-Cache](https://lwn.net/Articles/982887/) | 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 | |:----:|:----:|:---:|:----:|:---------:|:----:| diff --git a/study/kernel/00-DESCRIPTION/OPEN_SOURCE.md b/study/kernel/00-DESCRIPTION/OPEN_SOURCE.md index 7f0bc75..275413e 100644 --- a/study/kernel/00-DESCRIPTION/OPEN_SOURCE.md +++ b/study/kernel/00-DESCRIPTION/OPEN_SOURCE.md @@ -205,7 +205,7 @@ OSDI 的全称是 USENIX Symposium on Operating Systems Design and Implementatio | 日期 | 官网 | 链接 | GOOGLE 文档 | |:---:|:----:|:---:|:-----------:| | 2023/04/17-2023/04/19 | [5th OSPM Summit](https://retis.santannapisa.it/luca/ospm-summit/2023) | [LWN 汇总](https://lwn.net/Archives/ConferenceIndex/#OS-Directed_Power-Management_Summit-2023)
[LWN-Reports from OSPM 2023, part 1](https://lwn.net/Articles/934142)
[LWN-Reports from OSPM 2023, part 2](https://lwn.net/Articles/934459)
[LWN-Reports from OSPM 2023, part 3](https://lwn.net/Articles/935180) | [OSPM23 - topics - Google 云端硬盘](https://docs.google.com/spreadsheets/u/0/d/10AJFQporrCPH9Gn6-MaRotdfO4Hm4LG6dVAoDrQdj5A/htmlview?pli=1#gid=1185197977) | -| 2024/05/30-2024/05/21 | [6th OSPM Summit](https://retis.sssup.it/ospm-summit/2024) | [LWN 汇总]()
[LORE](https://lore.kernel.org/all/ZbJHfiWnujLz2Pfm@localhost.localdomain) | [OSPM24 - topics - Google 云端硬盘](https://docs.google.com/spreadsheets/d/13lOYsbNWhQU7pNbyHI97fC7GT0Eu8aMbU9ATvPJfV0A/edit?usp=sharing) | +| 2024/05/30-2024/05/21 | [6th OSPM Summit](https://retis.sssup.it/ospm-summit/2024) | [LWN, 2024/07/11, Reports from OSPM 2024, part 1](https://lwn.net/Articles/981371)
[LORE](https://lore.kernel.org/all/ZbJHfiWnujLz2Pfm@localhost.localdomain) | [OSPM24 - topics - Google 云端硬盘](https://docs.google.com/spreadsheets/d/13lOYsbNWhQU7pNbyHI97fC7GT0Eu8aMbU9ATvPJfV0A/edit?usp=sharing) | ## 6.7 [KernelPodCast](https://kernelpodcast.org) ------- diff --git a/study/kernel/00-DESCRIPTION/SCHEDULER.md b/study/kernel/00-DESCRIPTION/SCHEDULER.md index eadd93c..317dc6c 100644 --- a/study/kernel/00-DESCRIPTION/SCHEDULER.md +++ b/study/kernel/00-DESCRIPTION/SCHEDULER.md @@ -4713,6 +4713,9 @@ CAS 特性是通过 STATIC_KEY sched_asym_cpucapacity 控制的. EAS 特性是通过 STATIC_KEY sched_energy_present 控制的. +[Linux内核 算力感知调度](https://mp.weixin.qq.com/s/6-UPioWDvED0lQMAmF9Vfw) +[cpu算力归一化](https://zhuanlan.zhihu.com/p/707011550) + #### 7.2.4.1 Capacity Asymmetry Detection ------- @@ -5040,6 +5043,9 @@ DTB 中通过 OPP 字段标记 CPU 的电压及频率信息, 参见 [Documentati CPU 的 capacity 通过 capacity-dmips-mhz 来标记. CPU 的 power Energy Model 则提供了两种方式来注册, 一种是通过 dynamic-power-coefficient, 再结合电压和频率进行计算, 一种是不提供 dynamic-power-coefficient, 那么就要求在 OPP 表中通过 opp-microwatt 显式设置功耗数据. +> dmips-mhz +> dmips 是 Dhrystone Million Instructions Per Second 的缩写. 它是一个测量 CPU 运行一个叫 Dhrystone (整数运算)的测试程序时表现出来的相对性能高低的一个单位. Dhrystone 并不包括浮点运算, 其输出结果为每秒钟运行 Dhrystone 的次数, 即每秒钟迭代主循环的次数. Dhrystone的重要性在于其能作为处理器整数计算性能的指标. + | DTB 结构 | DTB 字段 | 描述 | |:-------:|:--------:|:---:| | cpu-map | clutser, core, thread | 标记 CPU 的 topology 信息. | @@ -5354,6 +5360,7 @@ CPUFreq 驱动是处理和平台相关的逻辑, Governor 中实现了具体的 | 2021/08/12 | Viresh Kumar | [Add callback to register with energy model](https://lore.kernel.org/patchwork/cover/1424708) | 当前许多 cpufreq 驱动程序向每个策略的注册了能耗模型, 并通过相同的操作 dev_pm_opp_of_register_em() 来完成. 但是随着 thermal-cooling 的完善, 可以在 cpufreq 层次通过新的回调 register_em 来完成这个工作. | v3 ☐ | [PatchWork V3,0/9](https://patchwork.kernel.org/project/linux-arm-kernel/cover/cover.1628742634.git.viresh.kumar@linaro.org) | | 2021/09/08| Viresh Kumar | [Inefficient OPPs](https://patchwork.kernel.org/project/linux-pm/cover/1631109930-290049-1-git-send-email-vincent.donnefort@arm.com) | schedutil 中增加了对低能效 (inefficient) OPP 的感知, 引入 CPUFREQ_RELATION_E 标记来使得 CPUFREQ 只使用和引用有效的频点.
Arm 的 Power 团队在为谷歌的 Pixel4 开发一个实验性内核, 以评估和改进现实生活中 Android 设备上的主线性能和能耗. 发现 SD855 SoC 有几个效率低下的 OPP. 这些 OPP 尽管频率较低, 但功耗却较高, 任务这种频率下工作, 性能不光下降了, 功耗也很高. 通过将它们从 EAS 能效模型中移除, 使得最高效的 CPU 在任务分配上更有吸引力, 有助于减少中、大型 CPU 的运行时间, 同时提高了集群的空闲时间. 由于集群之间存在巨大的能源成本差异, 因此增加空闲时间对该平台来说至关重要. | v7 ☑ 5.16-rc1 | [PatchWork v7,0/9](https://patchwork.kernel.org/project/linux-pm/cover/1631109930-290049-1-git-send-email-vincent.donnefort@arm.com) | | 2023/07/24 | Jie Zhan | [cpufreq: Support per-policy performance boost](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=218a06a79d9a98a96ef46bb003d4d8adb0962056) | 通过添加 "local_boost" sysfs 接口启用按策略提升. 与全局升压开关相同, 将 1/0 写入 "local_boost" 可分别启用 / 禁用 cpufreq 策略上的升压.
全局和本地增压控制的用户视图应为:
1. 启用全局增强最初会对所有策略启用本地增强, 然后可以对每个策略单独启用或禁用本地增强, 前提是平台确实支持.
2. 禁用全局 boost 会使启用本地 boost 成为非法, 而将 0 写入 "local_boost" 是可以的, 但不会生效. [Per-Policy CPU Performance Boosting Proposed For Linux](https://www.phoronix.com/news/Linux-Per-Policy-CPU-Perf-Boost) | v1 ☐☑✓ 6.6-rc1 | [LORE](https://lore.kernel.org/all/20230724075827.4160512-1-zhanjie9@hisilicon.com) | +| 2024/07/28 | Qais Yousef | [cpufreq: sched/schedutil: Remove LATENCY_MULTIPLIER](https://lore.kernel.org/all/20240728192659.58115-1-qyousef@layalina.io) | 1. 移除 LATENCY_MULTIPLIER: 旧版内核中存在一个称为 LATENCY_MULTIPLIER 的常量, 其值为 1000. 这个常量被用来放大频率转换延迟(transition latency), 以计算频率请求的速率限制(rate_limit_us). 但是, 由于现代硬件的快速响应能力, 这种放大已不再必要, 且可能导致不必要的延迟.
2. 更新 transition_delay_us 的计算方式: 补丁提出了一个新算法来计算 transition_delay_us, 即频率转换延迟的 1.5 倍. 这样做的目的是为了给硬件处理频率转换请求留出一定的余地, 但同时又避免了过大的延迟.
3. 考虑现代硬件的响应时间: 补丁指出, 现代硬件的响应时间通常很短, 例如在 M1 Mac Mini 上, 频率转换延迟仅为 50 到 56 微秒. 然而, 由于之前的 LATENCY_MULTIPLIER, 实际设置的 rate_limit_us 为 50 至 56 毫秒, 这被限制为 2 毫秒. 因此, 这个补丁旨在更好地反映现代硬件的能力.
4. 考虑突发负载的需求: 补丁提到现代工作负载经常需要系统能够快速响应负载的变化, 例如任务的睡眠/唤醒、迁移, 或者由于 uclamp 导致的突然提升或限制. 因此, 2 毫秒的延迟可能不再是最佳选择, 尤其是考虑到 2 毫秒大约是 120 Hz 显示刷新率周期的四分之一. | v1 ☐☑✓ | [LORE](https://lore.kernel.org/all/20240728192659.58115-1-qyousef@layalina.io) | #### 7.3.3.2 各个手机厂商基于 schedutil 的进一步优化和改进 @@ -7247,9 +7254,10 @@ ECRTS 2020(32nd Euromicro Conference on Real-Time Systems) 上 Daniel 等人发 ## 12.5 功耗 ------- + | 编号 | 工具 | 描述 | 链接 | |:---:|:----:|:---:|:---:| -| 1 | Turbostat | [tools/power/x86/turbostat](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/tools/power/x86/turbostat) | [Turbostat Gains New Features & New Hardware Support With Linux 6.10](https://www.phoronix.com/news/Linux-6.10-Turbostat) | +| 1 | Turbostat | [tools/power/x86/turbostat](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/tools/power/x86/turbostat) | [Turbostat Gains New Features & New Hardware Support With Linux 6.10](https://www.phoronix.com/news/Linux-6.10-Turbostat), [Linux's Turbostat Utility Can Now Be Used For Reading Intel PMT Counters](https://www.phoronix.com/news/Linux-6.11-Turbostat-PMT) | diff --git a/study/kernel/00-DESCRIPTION/TODO.md b/study/kernel/00-DESCRIPTION/TODO.md index fa7f7bd..475dd7a 100644 --- a/study/kernel/00-DESCRIPTION/TODO.md +++ b/study/kernel/00-DESCRIPTION/TODO.md @@ -659,6 +659,21 @@ cba6167f0adb [Updates to pahole](https://lwn.net/Articles/978727) [Eliminating indirect calls for security modules](https://lwn.net/Articles/979683) [A capability set for user namespaces](https://lwn.net/Articles/978846) +[A look inside the BPF verifier](https://lwn.net/Articles/982077) +[CRIB: checkpoint/restore in BPF](https://lwn.net/Articles/984313) + +[Direct-to-device networking](https://lwn.net/Articles/979549) + + +[FetchBPF: Customizable Prefetching Policies in Linux with eBPF](https://www.usenix.org/conference/atc24/presentation/cao) +[DINT: Fast In-Kernel Distributed Transactions with eBPF](https://www.usenix.org/conference/nsdi24/presentation/zhou-yang) +[Fast (Trapless) Kernel Probes Everywhere](https://atcosdi24.sched.com/event/1fLcd/fast-trapless-kernel-probes-everywhere), https://www.usenix.org/conference/atc24/presentation/jia + + +[Identifying On-/Off-CPU Bottlenecks Together with Blocked Samples](https://www.usenix.org/conference/osdi24/presentation/ahn) +[wPerf: Generic Off-CPU Analysis to Identify Bottleneck Waiting Events](https://www.usenix.org/conference/osdi18/presentation/zhou) + +[Harvesting Memory-bound CPU Stall Cycles in Software with MSH](https://www.usenix.org/conference/osdi24/presentation/luo) [OS2ATC-PPT](https://cloud.tsinghua.edu.cn/d/8e6c77ad1ad548acb909/) @@ -754,30 +769,5 @@ HUAWEI P10 Plus, Vicky, Android 7.0, EMUI 5.1 - - -Proxy Execution 是一种通用形式的优先级继承机制, 它旨在解决在多处理器系统中出现的优先级反转问题. 传统的优先级继承机制在实时任务之间工作良好, 但在复杂的工作负载中, 尤其是在涉及完全公平调度器 (CFS) 或 SCHED_DEADLINE 任务时, 传统的优先级继承机制可能会失效. 这是因为这些任务的调度不仅取决于优先级, 还取决于其他因素, 如任务的运行时间、截止时间等. - -实现思想 -Proxy Execution 的核心思想是, 当一个任务因为持有互斥锁而阻止另一个更高优先级的任务运行时, 持有锁的任务将 "代表" 被阻塞的任务运行. 这样做的目的是确保高优先级的任务不会被低优先级的任务长时间阻塞. - -具体实现 - -通过保持被阻塞任务在就绪队列上、跟踪阻塞状态、选择持有互斥锁的任务作为代理、分离调度和执行上下文等方式实现了优先级继承. 这些变化旨在解决传统优先级继承机制在复杂场景下的局限性, 尤其是涉及多处理器系统中的 CFS 和 SCHED_DEADLINE 任务. - -| 编号 | 目标 | 描述 | 实现细节 | -|:---:|:----:|:---:|:----:| -| 1 | 保持阻塞任务在就绪队列上 | 阻塞等待互斥锁的任务不会被从就绪队列中移除.
这样, 当选择下一个任务运行时, 即使任务被阻塞, 它仍然可以被选中. | -| 2 | 跟踪阻塞任务的状态 | 任务结构中增加额外的状态来跟踪哪个互斥锁被阻塞, 以及哪个任务持有该锁.
当一个任务被选中运行时, 如果它是被阻塞的, 那么系统会查找该任务被阻塞的互斥锁, 并找到持有该锁的任务. | 1. 任务状态更新: 更新了 task_struct 结构, 引入了新的字段来跟踪阻塞状态和阻塞原因.
2. 修改了互斥锁的数据结构以支持手递 (handoff) 模式而不是乐观自旋(optimistic spinning). | -| 3 | 选择互斥锁持有者作为代理 | 当一个被阻塞的任务被选中时, 实际上会运行持有相应互斥锁的任务.
持有锁的任务现在继承了被阻塞任务的调度属性, 从而代表被阻塞的任务运行. | 1. 重构了调度器逻辑, 包括 pick_next_task() 函数, 使其能够选择合适的任务运行, 即使该任务被阻塞.
2. 引入了新的函数如 find_proxy_task() 来寻找合适的代理任务. [PATCH v7, 11/23] sched: Add a initial sketch of the find_proxy_task() function](https://lore.kernel.org/all/20231220001856.3710363-12-jstultz@google.com), [PATCH v7, 13/23, sched: Start blocked_on chain processing in find_proxy_task()](https://lore.kernel.org/all/20231220001856.3710363-14-jstultz@google.com) 以及 [PATCH v7, 16/23, sched: Add deactivated (sleeping) owner handling to find_proxy_task()](https://lore.kernel.org/all/20231220001856.3710363-17-jstultz@google.com)
3. 为了解决 RT 和 DL 负载平衡问题, 引入了链级平衡处理. | -| 4 | 调度器上下文和执行上下文的分离 | 调度器需要跟踪两个概念: "scheduler context"(即选择的任务和用于调度决策的状态)和 "execution context"(实际正在运行的任务). 这种分离允许持有锁的任务代表被阻塞的任务运行. | [PATCH v7 08/23, sched: Split scheduler and execution contexts](https://lore.kernel.org/all/20231220001856.3710363-9-jstultz@google.com) 将调度上下文定义为 task_struct 中选定要运行的任务的所有调度器状态, 将执行上下文定义为实际运行任务所需的所有状态 通过在逻辑上拆分这些任务, 以便我们可以使用所选要调度的任务的调度上下文, 但实际运行时使用不同任务的执行上下文. 为此, 引入 rq_selectd() 宏指向调度程序从运行队列中选择的 task_struct, 并将用于调度程序状态, 并保留 rq->curr 以指示实际运行的任务的执行上下文. | -| 5 | 处理复杂的边缘情况 | 比如互斥锁持有者自身也可能被阻塞, 或者在不同的 CPU 上运行, 或处于迁移状态等.
为了处理这些复杂情况, Proxy Execution 引入了额外的逻辑来处理这些边缘情况. | 比如:
1. 当一个被阻塞的任务最终获得所需的资源时, 它需要被迁移到适当的 CPU 上. 优化了返回迁移逻辑, 例如避免在不适当的时间迁移任务. | - - -测试案例: -为了验证负载平衡不变性, 引入了一个名为 sched_football 的测试案例. -这个测试案例模拟了锁链上的任务调度, 以验证 Proxy Execution 是否正确处理了 RT 和 DL 负载平衡. -总结 - - - +这个补丁系列是关于为 Rust 语言在 Linux 内核中添加通用的内核分配器(Allocator)支持. 以下是补丁系列的主要变更和目的:
1. 添加通用内核分配器支持: 目前主线上, Rust 在 Linux 内核中的内存分配仅限于 kmalloc. 这个补丁系列扩展了这一功能, 允许使用更多的内存分配器以及分配策略.
2. 自定义 Allocator trait: 为了避免向内核添加不稳定的 Rust 特性, 补丁系列没有扩展 Rust 的 alloc crate 中的 Allocator trait, 也没有扩展 BoxExt 和 VecExt 扩展. 而是引入了特定的 Allocator trait, 并由 Kmalloc、Vmalloc 和 KVmalloc 分配器实现, 这些分配器也是在这个系列中实现的. 为了使用新的分配器, 补丁系列添加了自定义的 `Box` 和 `Vec`` 类型(其中 A 是特定的分配器), 这些类型依赖于特定的分配器.
3. 移除对 alloc crate 的依赖: 通过这个系列的更改, 内核构建完全移除了对 Rust 的 alloc crate 的依赖. +定义内核专用类型: 定义了内核专用的 Box 和 Vec 类型, . \ No newline at end of file