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

泰晓Linux知识星球:1300+知识点,520+用户
请稍侯

泰晓资讯·8 月 / 第一期 / 2022

unicornx 创作于 2022/08/04

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

Linux 内核最新消息

https://lkml.org/lkml/2022/7/31/295

Linus Torvalds 于本周正式发布了 Linux 5.19。Linux 5.19 带来了许多新功能,这包括:支持新的 CPU 架构 - LoongArch,继续开发 AMD Zen 4 CPU 和 AMD RDNA3,增加了更多对 Intel DG2/Alchemist 的支持、对 Alder Lake 的 Intel Idle 驱动程序支持、最初的 Raptor Lake P 图形支持, Zstd 压缩固件,以及一些不错的性能改进。

在 Linux 5.19 发布公告中,Linus Torvalds 还提到这是他第一次在一台使用 AArch64 Apple M2 SoC 的 Apple MacBook 笔记本电脑上写邮件发布新的 Linux 内核。这要归功于 Asahi Linux 项目的工作。原文如下:

On a personal note, the most interesting part here is that I did the release (and am writing this) on an arm64 laptop. It’s something I’ve been waiting for for a loong time, and it’s finally reality, thanks to the Asahi team. We’ve had arm64 hardware around running Linux for a long time, but none of it has really been usable as a development platform until now.

It’s the third time I’m using Apple hardware for Linux development - I did it many years ago for powerpc development on a ppc970 machine. And then a decade+ ago when the Macbook Air was the only real thin-and-lite around. And now as an arm64 platform.

Not that I’ve used it for any real work, I literally have only been doing test builds and boots and now the actual release tagging. But I’m trying to make sure that the next time I travel, I can travel with this as a laptop and finally dogfooding the arm64 side too.

Linus Torvalds 还指出,他最终可能会将 Linux 5.20 命名为 Linux 6.0。

https://www.kernel.org/ updated by 2022/8/4

分支类型版本发布时间
mainline5.192022-07-31
stable5.18.162022-08-03
longterm5.15.592022-08-03
longterm5.10.1352022-08-03
longterm5.4.2092022-08-03
longterm4.19.2542022-07-29
longterm4.14.2902022-07-29
longterm4.9.3252022-07-29
linux-nextnext-202208032022-08-03

关键词: Linux

Linux 5.20 可能被称为 Linux 6.0

In case you missed it in yesterday’s Linux 5.19 announcement and to avoid reader questions/confusion in the days ahead, just making it loud and clear here: what was referred to as the Linux 5.20 kernel in development will most likely be called Linux 6.0.

根据最新的版本号更新规则,Linus Torvalds 通常会在小版本达到 19 或者 20 后升级大版本号,譬如 Linux 3.19 之后就是 Linux 4.0,而 Linux 5.0 出现在 Linux 4.20 之后。他并不确定主要版本的升级是在 19 还是 20 之后出现,他经常开玩笑说这么做是因为他习惯用手指加上脚趾来数数。在本周日的 Linux 5.19 发布公告中,他表示想将下一个内核版本号升级到 6.0。Torvalds 说:“I'll likely call it 6.0 since I'm starting to worry about getting confused by big numbers again.”

因此,所有围绕 Linux 5.20 的重大功能补丁都可能被命名为 Linux 6.0。下一个 merge window 中可能看到的改动包括:早期版本的 Rust for Linux,MGLRU、PREEMPT_RT 补丁最终完全合入内核主线,Intel DG2/Alchemist graphics,AMD RDNA3,以及其他更多的新特性。

新闻出处,“Linux 5.20 Likely To Be Called Linux 6.0”: https://www.phoronix.com/news/Linux-5.20-Is-Linux-6.0

关键词: Linux

Linux 6.0 将对实时内核禁用通过控制台打印

As part of getting PREEMPT_RT support ready to be mainlined at long last for real-time kernel builds, a number of Linux 6.0 (nee 5.20) pull requests have revolved around additional RT preparatory changes. With the printk changes for Linux 6.0, the console drivers will now be skipped in RT mode.

考虑到 PREEMPT_RT 将被合入内核主线,为了支持实时内核,许多针对 Linux 6.0(即 5.20)的 PR 都针对该 RT 特性做相应的更改。特别是有关 printk 的改动,现在在 RT 运行模式下将直接禁用控制台驱动程序。

printk 的 PR 解释说:"Completely disable printing on consoles with CONFIG_RT. They break RT guarantees. They are too slow to be called with raw spinlocks. They can't be called with normal spinlocks in an atomic context because RT spinlocks might sleep. It is going to get fixed by the kthreads and atomic consoles. In the meantime, the debugging of CONFIG_RT kernel will be possible only by the user space kernel log readers." 也就是说当我们启用 CONFIG_RT 构建的实时内核将完全禁用控制台上的打印。因为这会破坏内核对实时性的保证。由于控制台打印耗时较长,使用 raw spinlock 加锁会阻塞太长时间,在原子上下文中也不能使用普通的 spinlock,因为这些锁在 RT 模式下能会休眠。目前的计划是通过 kthreads 和 atomic 控制台来解决这个问题。同时,在调试实时内核时只能在用户空间通过查看内核日志进行。

新闻出处,“Linux 6.0 To Disable Printing On Consoles With Real-Time Kernels”: https://www.phoronix.com/news/Linux-6.0-RT-Skip-Console-Print

关键词: Linux, PREEMPT_RT, printk

Linux 6.0 对调度程序进行了一些重大更改,包括改进了针对 AMD Zen 的 NUMA 平衡

Ingo Molnar today submitted the main set of kernel scheduler updates for the in-development Linux 6.0 (nee 5.20). The scheduler updates contain some notable changes that will be interesting to benchmark in the days ahead.

Ingo Molnar 于本周一提交了针对 Linux 6.0(即 5.20)的内核调度程序更新集的主要部分。调度程序更新包含一些值得注意的更改,这些更改将在未来几天进行基准测试。

首先,是对 AMD Zen 系统上的 affine workloads 改进了 NUMA 平衡处理。这是为了处理之前报告的 sched/fair 中的性能优化,用于在 find_idlest_group() 函数中允许 NUMA 不平衡时对 CPU 亲和性的考虑。该补丁在特定情况下产生了非常好的加速效果。

Linux 6.0 的另一个值得注意的和调度程序有关的更改是由 Intel 主导,在繁重的系统负载下更高效地对空闲 CPU 进行搜索。

Linux 6.0 调度程序更改还包括改进负载平衡中容量减少的 CPU 的处理,针对 Energy Model (EM) 的改进,改进某些具有备用容量的系统上的 NUMA 不平衡行为,改进核心调度,通过允许 same-LLC 为新唤醒的任务唤醒空闲 CPU,以及其他各种小的优化和修复。还有一些与 PREEMPT_RT 相关的修复,这些实时内核补丁预计很快就会被合并。

新闻出处,“Linux 6.0 Has Some Big Scheduler Changes, Including Improved NUMA Balancing For AMD Zen”: https://www.phoronix.com/news/Linux-6.0-Scheduler

关键词: Linux,Scheduler

Rust for Linux 代码继续更新,实现了更多功能

Miguel Ojeda has posted the newest patch series implementing the Rust programming language infrastructure and initial sample code for the Linux kernel.

Miguel Ojeda 发布了 Rust for Linux 的最新的补丁版本 v8,进一步改进了使用 Rust 编程语言开发内核的基础设施。

早在 6 月的开源峰会上,Linus Torvalds 就评论说 Rust for Linux 有可能会在 5.20 合入内核主线。现在这事是否还会如期发生还有待观察,尤其是今天发布的 v8 补丁系列有许多新增内容,并且需要更多时间进行审查。所以在 Linux 6.0 的 merge window 关闭的最后一分钟前是否能够完成有待商榷,Rust for Linux 的内核部分代码可能仍需要更多时间。但无论如何,它离最终合并已经越来越近了。

Rust for Linux 的 v8 补丁中亮点如下:

  • 工具链升级到 Rust 1.62。
  • 修改 Rust for Linux 部分的构建 binding 关系,仅在涉及 kernel crate 发生修改时才构建,缩短构建时间。
  • 提高了运行 rust-analyzer 的速度。
  • 新增 “fs” 模块添加文件系统支持,同时支持了各种新类型、文件系统参数、文件系统标志和针对 Rust 中的文件系统示例的代码。
  • 新增对 Workqueues 的支持。
  • 扩展了异步支持,现在支持 executor、基于 Workqueues 的 executor、提供 yield_now() 可以放弃执行当前任务,此外还添加了一个异步 TCP echo 服务器的例子。
  • 支持处理中断。
  • 初始 RCU 支持。
  • 对 delays 和 sleep 的初步支持。

对于目前的状态,v8 补丁的总结是: "The Rust support is still to be considered experimental. However, support is good enough that kernel developers can start working on the Rust abstractions for subsystems and write drivers and other modules." 也就是说仍然还处于实验阶段。但支持已经足够好,内核开发人员可以使用 Rust 对内核子系统抽象的 API 编写驱动程序和其他模块。

新闻出处,“Rust Code For The Linux Kernel Updated With More Features Implemented”: https://www.phoronix.com/news/Rust-v8-For-Linux-Kernel

关键词: Linux,Rust

LLVM 16 默认为 RISC-V 启用可扩展矢量化

LLVM – With LLVM 15 branched and main now open for LLVM 16, one of the early changes for this next compiler release cycle is enabling scalable vectorization by default for RISC-V with supported targets for RISC-V vector instructions.

LLVM 项目在为 15 版本拉出自己的分支后,现在的 main 分支进入针对下一个版本 16 的开发阶段。针对 16 的修改点之一是默认为 RISC-V 启用可扩展矢量化(scalable vectorization),并为 target 支持 RISC-V 矢量指令。

LLVM 开发人员 Philip Reames 已默认启用可扩展矢量化,为 RISCV 的 target 支持 Zve (即 V 扩展)。他解释说:

This change enables vectorization (using scalable vectorization only, fixed vectors are not yet enabled) for RISCV when vector instructions are available for the target configuration.

At this point, the resulting configuration should be both stable (e.g. no crashes), and profitable (i.e. few cases where scalar loops beat vector ones), but is not going to be particularly well tuned (i.e. we emit the best possible vector loop). The goal of this change is to align testing across organizations and ensure the default configuration matches what downstreams are using as closely as possible.

This exposes a large amount of code which hasn’t otherwise been on by default, and thus may not have been fully exercised. Given that, having issues fall out is not unexpected. If you find issues, please make sure to include as much information as you can when reverting this change.

此更改在启用针对 RISCV 的矢量化时仅使用 scalable vectorization,而没有启用 fixed vectors)。这个修改涉及的地方比较多,所以 Philip 也不敢确认百分之百没有问题,但自修改以来两天过去了,到目前为止还没有发现什么问题,所以希望一切顺利。此更改是在 LLVM 16 开发周期开始时进行的,因此在稳定版发布(明年 3 月)之前仍有大量时间来改进编译器的 RISC-V 矢量化支持。

RISC-V 的 “V” 扩展是完整版的扩展规范,而 Zve 是它的一个适度瘦身的子集,旨在用于嵌入式设备和微控制器中那些较小的处理器核心。RISC-V 的 Vector Extension 1.0 自去年以来就已经处于 froze 状态,并被认为足够稳定,可以基于其开始软件开发工作。感兴趣的人可以通过 GitHub 找到 RISC-V V 扩展的 1.0 规范(https://github.com/riscv/riscv-v-spec)。

新闻出处,“LLVM 16 Enabling Scalable Vectorization By Default For RISC-V”: https://www.phoronix.com/news/LLVM-RISC-V-Vectorization-Def

关键词: LLVM,RISC-V, Zve

GNU C Library 2.36 发布,更多新功能,更多优化

Released overnight was a new version of Glibc, the GNU C Library, commonly used by Linux systems as the default libc implementation.

GNU 于本周发布了新版本的 Glibc - 2.36。GNU C 库 2.36 带来了许多新功能,以匹配较新版本的 Linux 内核所公开的功能,对现有功能进行了各种优化,引入了对来自中国龙芯的 LoongArch CPU 架构的支持等等。Glibc 2.36 的亮点包括:

  • 添加 Linux 内核中最新实现的和挂载相关的 API:fsopen/fsmount/move_mount/fsconfig/fspick/open_tree/mount_setattr
  • 添加了 arc4random/arc4random_buf/arc4random_uniform 这些类似于 BSD 上一直存在的函数。这些函数封装了 getrandom/dev/urandom 以利用内核提供的高质量随机数功能。
  • 支持 Linux 上的 LoongArch 64 位 CPU 架构。
  • 支持 Linux 上的 pidfd_open/pidfd_getfd/pidfd_send_signal 函数以及 process_madvise 函数。
  • 添加了 process_mrelease 函数,基于调用者的 CPU 亲和性和优先级释放垂死进程的内存,并将 CPU 使用率计入调用者。
  • 添加了 “no-aaaa” DNS stub resolver 以抑制 stub resolver 进行的 AAAA 查询。
  • 支持 “DT_RELR” 相对重定位格式,以改进共享对象和位置无关可执行文件中相对重定位的大小。
  • 放弃各种 SSSE3 优化。
  • Arm SVE 优化的内存拷贝。
  • AVX2 和 EVEX 优化版本的 strncasecmp 和 strcasecmp。
  • 许多错误修复。

更多详细信息可以参阅 GNU C 库 2.36 的发布公告(https://sourceware.org/pipermail/libc-alpha/2022-August/141193.html)。对于通常情况下该项目半年一个的发布节奏来说,这是一个相当健康的更新。

新闻出处,“GNU C Library 2.36 Released With New Functions, More Optimizations”: https://www.phoronix.com/news/GNU-C-Library-Glibc-2.36

关键词: Glibc

联系我们

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

tinylab wechat



Read Album:

Read Related:

Read Latest: