泰晓科技 -- 聚焦 Linux - 追本溯源,见微知著!
网站地址:https://tinylab.org

泰晓RISC-V实验箱,不会吃灰,开箱即用
请稍侯

泰晓资讯·12 月 / 第二期 / 2022

unicornx 创作于 2022/12/08

“泰晓资讯”,广泛报道 “Linux/开源” 业界资讯。欢迎广大读者投递相关资讯来源和素材,本站将进一步收集整理后发布给大家。

Linux 内核最新消息

https://lkml.org/lkml/2022/12/4/264

正如预期的那样,由于 6.1 的开发周期中后期内核补丁的增加,Linus Torvalds 本周选择发布了 Linux 6.1-rc8,而不是直接发布 Linux 6.1 的稳定版本,6.1 有望作为今年的长期支持(LTS)内核。

在 Linux 6.1-rc8 中,幸运的是,经过过去几周的忙碌,这个版本已经开始稳定下来。但 Linus 仍然谨慎行事,发布了这个额外的 RC 版本。他在 6.1-rc8 公告中评论如下:

So we’ve finally started calming down, and rc8 is noticeably smaller than previous release candidates.

So everything looks good, and while the calming down may have happened later than I wished for, it did happen. Let’s hope this upcoming week is as quiet (or quieter).

整体来看,Linux 6.1-rc8 中的修复都没什么特别的,唯一值得注意的是合入了一个针对性能回归的修复。本期会有专门一篇文章对此进行介绍。

https://www.kernel.org/ updated by 2022/12/1

分支类型版本发布时间
mainline6.1-rc82022-12-04
stable6.0.112022-12-02
longterm5.15.812022-12-02
longterm5.10.1572022-12-02
longterm5.4.2252022-11-25
longterm4.19.2672022-11-25
longterm4.14.3002022-11-25
longterm4.9.3342022-11-25
linux-nextnext-202212072022-12-07

关键词: Linux

Linux 6.1 回退了三行代码,避免了一个 “巨大的性能衰退问题”

Ahead of the Linux 6.1-rc8 kernel that Linus Torvalds is expected to issue shortly rather than going straight to Linux 6.1 stable, a revert for a small change leading to “huge performance regressions” in select areas has fortunately been caught and reverted.

幸运的是,就在 Linus Torvalds 准备发布的 Linux 6.1-rc8 之前,一个在特定情况下会导致 巨大的性能衰退(原文是 “huge performance regressions”)的改动被发现并修复。

在 Linux 6.1 合并窗口期间,提交了一个针对内存管理的更改,目的是为了将较大的匿名映射与 THP 边界对齐。提交的理由原文如下:

Align larger anonymous memory mappings on THP boundaries by going through thp_get_unmapped_area if THPs are enabled for the current process.

With this patch, larger anonymous mappings are now THP aligned. When a malloc library allocates a 2MB or larger arena, that arena can now be mapped with THPs right from the start, which can result in better TLB hit rates and execution time.

但测试中发现,更改的这三行代码在某些方面会导致 Linux 6.1 内核性能倒退。

来自 Intel 的内核测试发现,在可追溯到该更改的某个基准测试中,导致了 95% 的性能下降。该基准测试在现实中并不容易发生,但它确实引起了人们对其他场景下可能受到影响的担忧,这些场景尚未在 Linux 6.1 的开发版本上进行测试。

Linux 开发人员 Nathan Chancellor 也报告了引入这个补丁后执行内核构建时发现耗时大幅增加。在 Threadripper 3990X 工作站上构建他所有的内核构建,从 2 小时 20 分钟变成了 3 个多小时,特别地,对于 x86_64 allmodconfig 构建,从 318 秒变为 406 秒。

因此,现在 Linus Torvalds 决定回退这仅包含 3 行代码修改的补丁,先避免所谓的 “巨大的性能衰退”,直到找到更好的解决方法。

新闻出处,“Linux 6.1 Lands Revert For “Huge Performance Regressions” From Three Lines Of Code”: https://www.phoronix.com/news/Linux-6.1-Regression-Fix

关键词: Linux, Compute Accelerator

新的 MGLRU 补丁能够提高全局回收的可扩展性

Among the many exciting new features in Linux 6.1 is the merging of the Multi-Gen LRU “MGLRU” code as what has shaped up to be one of the best kernel innovations for 2022 for overhauling the Linux kernel’s page reclamation code. The performance results already are very promising and MGLRU is being used successfully at Google and other large deployments. The work isn’t over though on further advancing the kernel in this area.

在 Linux 6.1 中众多令人兴奋的新功能之一是合并了Multi-Gen LRU (简称 “MGLRU”)这个补丁,它是 2022 年里最好的内核创新之一,该补丁彻底修改了 Linux 内核的页面回收代码。性能结果非常可观,MGLRU 正在 Google 和其他大型系统部署中成功使用。不过,进一步推进该领域的内核工作还没有结束。

MGLRU 在 Linux 6.1 中看起来很棒,并且正在继续发展。来自 Google 的工程师 Yu Zhao 一直在领导推动 MGLRU 补丁进入 Linux 内核上游的工作,上周他提交了一组新的增强功能。这组最新补丁针对 memcg LRU。以下是他对这项附加功能工作的总结:

An memcg LRU is a per-node LRU of memcgs. It is also an LRU of LRUs, since each node and memcg combination has an LRU of folios (see mem_cgroup_lruvec()).

Its goal is to improve the scalability of global reclaim, which is critical to system-wide memory overcommit in data centers. Note that memcg reclaim is currently out of scope.

Its memory bloat is a pointer to each LRU vector and negligible to each node. In terms of traversing memcgs during global reclaim, it improves the best-case complexity from O(n) to O(1) and does not affect the worst-case complexity O(n). Therefore, on average, it has a sublinear complexity in contrast to the current linear complexity. … In terms of global reclaim, it has two distinct features:

  1. Sharding, which allows each thread to start at a random memcg (in the old generation) and improves parallelism;
  2. Eventual fairness, which allows direct reclaim to bail out and reduces latency without affecting fairness over some time.

看上去这组补丁的目标是提高全局回收的可扩展性,这对于解决数据中心中存在的系统范围内存过载问题至关重要。修改后的算法在全局回收过程中遍历 memcgs 时的最佳复杂度从 O(n)提高到 O(1),最差复杂度仍然维持 O(n)不变。因此,平均而言,与当前的复杂度相比,其复杂度优化为亚线性。 。

目前为止,测试结果还很有限,但在一个衡量有效性的示例测试脚本中,MGLRU 表现出来的状态非常好。

Yu Zhao 表示预计很快就会有更多的基准结果分享出来。有关此最新MGLRU工作的更多详细信息,请参阅 memcg LRU 补丁(https://lore.kernel.org/lkml/20221201223923.873696-1-yuzhao@google.com/)。虽然这些补丁的提交时间是在 v6.2 的 merge 窗口期前,但预计它还不至于会被合入即将到来的 v6.2。

新闻出处,“New MGLRU Linux Patches Look To Improve The Scalability Of Global Reclaim”: https://www.phoronix.com/news/Linux-MGLRU-memcg-LRU

关键词: Linux,MGLRU

堪称古董级别的软盘驱动程序再次更新并准备好合入 Linux 6.2

As we get ready to enter 2023, the Linux kernel’s floppy disk driver is still being maintained.

Ahead of the Linux 6.2 merge window next week – in working towards the Linux 6.2 stable release around February as what will be the first major Linux release of 2023 – there is still some attention being paid to the floppy driver.

我们已准备进入 2023 年,而 Linux 内核的软盘驱动程序仍在维护中。

下周 Linux 6.2 的合并窗口即将打开,这意味着在 2 月份左右我们会努力发布新一版的 Linux 6.2 稳定版本,这将是 2023 年的第一个主要 Linux 版本,而在这个版本中我们将会看到仍然有一些针对软盘驱动程序的修复更新。

Denis Efremov 向 Linux 的 block 子系统维护者 Jens Axboe 提交了一版面向 Linux 6.2 的软盘驱动程序合并请求。软盘驱动程序更新已经很少了,但似乎仍然有人在基于最新的内核代码对其进行维护和更新。具体来说我们发现当软盘驱动程序其初始化路径中调用 floppy_alloc_disk() 失败时,存在潜在的内存泄露,而这个补丁正是为了解决这个问题。这个问题自 2020 年 Linux 5.11 以来就存在。今年早些时候,通过禁用了 FDRAWCMD 访问解决了一个释放后仍然会被使用的漏洞,另外还有一个补丁是解决如果弹出损坏的软盘则导致系统挂起的问题。近年来类似的问题解决了不少。

这次提交的针对软盘驱动程序内存泄漏的修复已为进入 Linux 6.2 做好了准备,并且还标记为会后向移植到 Linux 内核的稳定版本系列。

新闻出处,“Floppy Driver Update Ready For Linux 6.2 - Still Being Maintained In 2023”: https://www.phoronix.com/news/Linux-6.2-Floppy

关键词: Linux, 软盘,驱动

GCC Rust 前端 v4 已发布,会被合入 GCC 13 中

The GCC Rust front-end that provides very preliminary support for the Rust programming language atop the GNU Compiler Collection is now cleared for merging to the mainline codebase!

GCC Rust 前端使用 GNU 编译器套件开发 Rust 编程语言提供了非常初步的支持,现在已为合并到主线代码库做好准备!

今年早些时候,GCC 指导委员会批准了 Rust,而新的前端代码仍需经过审查。今天早上发布的是 GCC Rust 前端补丁的第四次迭代以供审查,并且已经声明此代码现在可以合并了。

Arthur Cohen 在提交 GCC Rust v4 补丁时的说明如下:

This patchset contains the fixed version of our most recent patchset. We have fixed most of the issues noted in the previous round of reviews, and are keeping some for later as they would otherwise create too many conflicts with our updated development branch.

Similarly to the previous round of patches, this patchset does not contain any new features - only fixes for the reviews of the v3. New features will follow shortly once that first patchset is merged.

需要重申的是,这个 GCC Rust 前端仍处于早期阶段,并不像在 LLVM 上构建的 Rust 编译器那样功能完整。但是对于当前的 v4 补丁代码来说,现在的状态已经足够好,可以进行初始合并。已确定的是它将被合入 GCC 13,最初的稳定版本将会在 3 月 ~ 4 月左右发布的 GCC 13.1 中出现,希望一年后的 GCC 14 中将提供一个功能更完整的实现,使其成为基于 LLVM 的 Rust 编译器之外更可行的替代品。

新闻出处,“GCC Rust Front-End v4 Posted - Now Cleared For Merging In GCC 13”: https://www.phoronix.com/news/GCC-Rust-v4-Cleared-For-Landing

关键词: GCC,Rust

联系我们

欢迎扫描二维码加微信联系我们:

tinylab wechat



Read Album:

Read Related:

Read Latest: