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

基于泰晓RISC-V实验箱的Linux公开课
请稍侯

泰晓资讯·6月 / 第三期 / 2021

unicornx 创作于 2021/06/19

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

Linux 内核最新消息

https://lkml.org/lkml/2021/6/13/222

在发布了几周的 5.13-rc 版本之后,Linux 5.13-rc6 的变化超出了 Linus Torvalds 的预期,现在 Linux 5.13-rc6 已经发布,而且规模较小,同时为内核开发的后期阶段做好了准备。

Torvalds 在 5.13-rc6 的发布邮件中说,“到目前为止,大多数修改集中在驱动代码(包括 usb、gpu、regulator、rdma、spi、pinctrl、scsi ..),以及其他一些方面:譬如针对 x86 架构的修改(主要是 kvm) , 针对 RISC-V 体系架构的改进, 很小的 btrfs 和 nfs 客户端修复, 几个核心内核 (调度程序, 跟踪等) 的 修复。这些改动都非常小。我们希望这个趋势继续保持,这样我们会按时发布 5.13 版本。请大家继续测试和验证。”

Linux 5.13 应该会在 6 月底或 7 月的第一周发布,具体取决于接下来两周的情况。

https://www.kernel.org/

分支类型版本发布时间
mainline5.13-rc62021-06-13
stable5.12.122021-06-18
longterm5.10.452021-06-18
longterm5.4.1272021-06-18
longterm4.19.1952021-06-16
longterm4.14.2372021-06-16
longterm4.9.2732021-06-16
longterm4.4.2732021-06-16
linux-nextnext-202106182021-06-18

关键词: Linux

近期 Linux 内核的重要补丁(节选)

Architecture-specific

Core kernel

Memory management

关键词: Linux

Clang 对 Profile Guided Optimizations (PGO) 的支持可能会在 Linux 5.14 中出现

Recently the mainline Linux kernel has seen a lot of improvements to its feature set when compiling it under LLVM’s Clang rather than GCC as traditionally the only supported compiler. The most recent feature being brought to the Linux kernel when using Clang is finally allowing the use of compiler profile guided optimizations (PGO) for squeezing even greater performance out of the system by letting the compiler leverage the real-world profiles/metrics collected to make more informed code generation / optimization decisions.

最近,主线 Linux 内核使用 LLVM 的 Clang(而非传统的 GCC)编译产生的代码性能有了很多改进。 编译器的配置文件优化(profile guided optimizations,简称 PGO)功能通过让编译器利用收集到的实际配置文件(包含了指标参数)来生成更明智的优化代码,从而从系统中榨取更高的性能。

采用 Clang 编译 Linux 时,最近引入了对 link-time optimizations (LTO)  的支持,这也是一种提高性能优化的措施。 在此基础上,这也使得另一项优化措施 Clang Control Flow Integrity (CFI) 被合入内核主线。 过去,针对 Linux 内核也有补丁提出支持 GCC 的 LTO 和 PGO 功能,但它们一直没有被合入主线。

Clang 上 对 Linux 内核的 PGO 支持目前由来自 Google 的 Kees Cook 提交在 for-next/clang/features 中。该补丁由 Google 工程师开发,他们多年来一直使用 Clang 为 Android 和 Chrome OS 构建 Linux 内核和其他组件。 由于已经进入 for-next 仓库,所以貌似该特性很有可能在即将到来的 Linux 5.14 合并窗口中被合入主线。

该新特性允许我们使用配置文件配合 Clang 编译器一起使用。 有兴趣的人可以使用这个新的 PGO 基础设施构建内核,启动该内核并运行他们想要/相关的工作负载,收集配置文件并处理它们,然后利用所述配置文件数据重建内核。 理想情况下,这个支持 PGO 的内核构建应该具有一些性能优势,这要归功于 Clang 能够通过收集到的数据做出更明智的选择。

新闻出处,”Profile Guided Optimizations (PGO) Likely Coming To Linux 5.14 For Clang”: https://www.phoronix.com/scan.php?page=news_item&px=Clang-PGO-For-Linux-Next

关键词: Clang,PGO,Linux

“Memory Folios” 工作仍在继续 - 提高 Linux 性能,内核构建速度提高 7%

Matthew Wilcox of Oracle today sent out his latest patch series implementing the new “memory folios” type for the Linux kernel in an effort to improve Linux memory management and allow for better efficiency that ultimately translates into measurable performance gains.

来自 Oracle 的 Matthew Wilcox 近日发布了他的最新补丁系列,为 Linux 内核实现了新的 “memory folios”,以努力改进 Linux 内存管理并提高效率,最终转化为可衡量的性能提升。

有关具体什么是 “memory folios”,可以参考 Matthew 在该补丁中的描述(摘录)如下:

Managing memory in 4KiB pages is a serious overhead. Many benchmarks benefit from a larger "page size". As an example, an earlier iteration of this idea which used compound pages (and wasn't particularly tuned) got a 7% performance boost when compiling the kernel.

Using compound pages or THPs [transparent hugepages] exposes a weakness of our type system. Functions are often unprepared for compound pages to be passed to them, and may only act on PAGE_SIZE chunks. Even functions which are aware of compound pages may expect a head page, and do the wrong thing if passed a tail page.

We also waste a lot of instructions ensuring that we're not looking at a tail page. Almost every call to PageFoo() contains one or more hidden calls to compound_head(). This also happens for get_page(), put_page() and many more functions. There does not appear to be a way to tell gcc that it can cache the result of compound_head(), nor is there a way to tell it that compound_head() is idempotent.

This patch series uses a new type, the struct folio, to manage memory. It provides some basic infrastructure that's worthwhile in its own right, shrinking the kernel by about 6kB of text.

基准测试结果有限,但从迄今为止的数据来看,memory folios 的改进效果都很明显。但需要注意的是,这是一个庞大的补丁系列,并非所有工作都已准备就绪,因此可能需要一段时间才能将整个修改准备好以达到可以进入主线的标准,尤其是考虑到这是对 Linux 内存管理代码的一个很根本性的变化。

新闻出处,“The “Memory Folios” Work Continues - Improving Linux Performance, 7% Faster Kernel Builds” https://www.phoronix.com/scan.php?page=news_item&px=Memory-Folios-Linux-v11

关键词: Memory, Linux

Google 希望在 Linux 内核中看到 Rust 代码,与主要开发人员签订合同

Google wants to see Rust programming language support within the Linux kernel so much so that they have contracted the lead developer working on “Rust for Linux” as the work aims to get mainlined.

Google 非常希望在 Linux 内核中看到对 Rust 编程语言支持,以至于他们与 Rust 的主要开发人员签订了 “Rust for Linux” 合同,目标就是为了将内核对 Rust 的支持主线化。

Google 于今日宣布,正式支持采用 Rust 开发 Linux 内核以增强内存安全性,并且他们已与开发人员 Miguel Ojeda 签约,以进一步推进他在 Rust 开发工作中对 Linux 内核的支持以及相关安全工作。这份合同至少要持续到明年。

除了在内核中使用 Rust 吸引新的开发人员和引入新的开发方式之外,Google 的这种公开支持和签约 Miguel 的主要动机是提高内核的内存安全性。

这个消息说实话并不令人意外。 继内核中 Rust 的 RFC 补丁系列之后,Google 当时已经表达了他们对 Rust 的支持,今年早些时候已经开始允许使用 Rust 开发 Android。

新闻出处,“Google Wants To See Rust Code In The Linux Kernel, Contracts The Main Developer” https://www.phoronix.com/scan.php?page=news_item&px=Google-Wants-Rust-In-Kernel

关键词: Google, Linux, Rust

Linux 将对 RISC-V 支持 Transparent Hugepages

The Linux kernel’s RISC-V support continues picking up remaining features not yet wired up beyond the base architecture support. The latest is transparent hugepages (THP) to be supported for RISC-V with Linux 5.14.

Linux 继最近针对 RISC-V 体系架构添加 XIP、KProbes 等其他功能,以及支持 SiFive FU740 SoC 等硬件的工作之后,最新的 RISC-V 内核特性是增加对 Transparent Hugepages 的支持,现已准备就绪。

Transparent Hugepages 是 Linux 内存管理功能,用于减少页面查找 TLB 开销并提高性能,特别是对于具有大量内存的系统。 除了某些工作负载(如某些数据库服务器)之外,THP 可以提高性能,同时以透明的方式提供大页面支持,而无需应用程序进行任何额外的工作/更改。

感谢来自于华为的工程师对内核的工作,64 位 RISC-V 上的 THP 支持现已准备就绪,并且已合入 RISC-V 的 Linux 内核 “for-next” 分支,预期在未来几周内随 Linux 5.14 合并周期合入内核主线。

新闻出处,“Transparent Hugepages Are Coming To RISC-V On Linux” https://www.phoronix.com/scan.php?page=news_item&px=THP-Hugepages-For-RISC-V

关键词: Linux,RISC-V,Transparent Hugepages

GNU C 库希望放弃 FSF 版权分配政策

The GCC compiler has long had a requirement that all contributors assign their copyright to the Free Software Foundation. Recently GCC dropped that copyright assignment policy and now the GNU C Library is looking at making a similar move.

GCC 编译器长期以来一直要求所有贡献者将其版权转让给自由软件基金会。最近 GCC 放弃了该要求,现在 GNU C 库正在考虑采取类似的举措,不再要求将版权转让给自由软件基金会。

该举措将于 8 月初生效。 Glibc 管理员仍在寻求对此事的反馈,但到目前为止,开发人员似乎绝大多数都赞成取消这一要求,尤其是当越来越多的开发人员试图与自由软件基金会保持距离时。

代替版权转让政策的方式是在他们的提交中使用开发者原产地证书和 Git Signed-off-by 标签。 无论如何,Glibc 将继续在 LGPLv2.1 或更高版本的许可下开发。

新闻出处,“GNU C Library Looking To Drop FSF Copyright Assignment Policy” https://www.phoronix.com/scan.php?page=news_item&px=Glibc-Drop-Copyright-Assignment

关键词: GIBC

联系我们

资讯内容部分来自 “LWN.net“。如果您对某些 LWN 文章感兴趣(譬如希望获得全文翻译的)请扫描二维码加微信联系我们:

tinylab wechat



Read Album:

Read Related:

Read Latest: