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

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

泰晓资讯·9月 / 第二期 / 2021

unicornx 创作于 2021/09/09

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

Linux 内核最新消息

本周尚处于 Linux 5.15 版本的合并窗口期,本期资讯我们会侧重给大家介绍一些令人感兴趣的,并有可能会合入下一个大版本 5.15 的新特性。

https://www.kernel.org/

分支类型版本发布时间
mainline5.142021-08-29
stable5.14.22021-09-08
stable5.13.152021-09-08
longterm5.10.632021-09-08
longterm5.4.1442021-09-03
longterm4.19.2062021-09-03
longterm4.14.2462021-09-03
longterm4.9.2822021-09-03
longterm4.4.2832021-09-03
linux-nextnext-202109082021-09-08

关键词: Linux

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

Architecture-specific

Core kernel

关键词: Linux

泰晓社区发布 Linux Lab v0.8-rc2,Pocket Linux 与 Linux Lab Disk 同时支持 Manjaro

Linux Lab v0.8-rc2 本次主要变更如下:

  1. 早期文档中描述的更新步骤较重,替换为更为轻量级的更新步骤。
  2. 在 MacOS 系统上,由于无法正常创建 console, null 等设备文件,导致无法正常启动系统,对于用户提报的 i386/pc,把默认文件系统格式改为 cpio,临时 workaround 该问题。
  3. 修复 make clean 错误,先执行 kernel clean,再做 git reset,避免清理掉 kernel clean 必须的 patch。
  4. 进一步清理 rootfs 各种格式的依赖关系。
  5. 进一步优化 make debug,确保 debug 基于最新的改动。
  6. 清理不必要的 1234 端口映射,该部分可以让用户按需开启。

ArchLinux 作为一个特殊的存在,其带来的专属优化、滚动更新、软件丰富等特性都非常吸引人,所以很多同学希望能为 Linux Lab Disk 和 Pocket Linux Disk 适配它或相关变体 Manjaro,经过慎重考虑,泰晓社区最终选择了发布节奏更为平缓一些的 Manjaro。

新闻出处,“社区发布 Linux Lab v0.8-rc2,Pocket Linux 与 Linux Lab Disk 同时支持 Manjaro”: https://tinylab.org/manjaro2go/

关键词: Linux Lab, Pocket Linux

Linux 5.15 进一步增加对 RISC-V 的支持

The RISC-V architecture updates have landed in the Linux 5.15 kernel with more software features now being supported.

针对 RISC-V 架构的代码更新已提交给 Linux 5.15 内核。本次更新将支持更多软件功能,修改包括:Undefined Behavior Sanitizer (UBSan) 现在可用于检测内核中未定义的行为;支持 KProbes 中与 PC 相关的指令;支持 hlt 和 nohlt 内核命令行选项;以及大量代码清理。还有一个值得注意的改进是,针对 Linux 5.15,RISC-V 现在还允许通过 CMA 分配器分配大页并支持大页迁移。

详细的完整代码提交列表可以参阅这里:http://lkml.iu.edu/hypermail/linux/kernel/2109.0/03784.html

新闻出处,“Linux 5.15 Further Tunes Its RISC-V Support” https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.15-RISC-V

关键词: Linux,RISC-V

Amazon 的 DAMON 进入 Linux 5.15

The DAMON kernel functionality developed by Amazon engineers has successfully landed in the Linux 5.15 tree.

作为上周由 Andrew Morton 整合到内核中的 147 个补丁的一部分,最显着的新增功能是 DAMON。自 2020 年初以来,Amazon 一直在为 DAMON 提供了补丁,该特性加入 Linux 内核后可以提供更好对内核数据进行监控。最新的应用领域是用于 proactive reclamation of system memory

在过去一年半的时间里,DAMON 代码经过了大约三十多次审查,本周终于被合并到 Linux 5.15 的主线。本次合并并不出人意料,因为一个月前 Andrew Morton 表示他会为此做好准备。核心 DAMON 代码不到 4000 行代码,而接下来看看内核中可能出现哪些基于 DAMON 的新解决方案将会非常有趣。

新闻出处,“Amazon’s DAMON Merged Into Linux 5.15 For Data Access Monitoring Framework”: https://www.phoronix.com/scan.php?page=news_item&px=DAMON-Merged-Linux-5.15

关键词: Linux,Amazon,DAMON

Linux 5.15 的 “-Werror” 新行为引发社区热议

Landing this past weekend was the surprise move by Linus Torvalds to enable “-Werror” behavior by default for all kernel builds. That compiler flag addition makes all warnings be treated as errors, which in turn stops the kernel build. As expected, this change has led to quite a mess.

上周末 Linus Torvalds 出人意料的举动引发了热区的热烈的讨论,他为所有内核构建默认启用 “-Werror” 行为。添加的这个编译选项使所有警告都被视为错误,这会终止内核构建。正如预期的那样,这种变化导致了相当大的混乱。

来自 Google 的 Nick Desaulniers 参与了 Linux 内核的 LLVM Clang 构建,最终提交了一个补丁来恢复 Linus Torvalds 的更改。 Nick 指出,“While I can appreciate the intent of enabling -Werror, I don't think it is the right tool to address the root cause of developers not testing certain toolchains or configurations, or taking existing reports they're getting serious enough... -Werror is great for preventing new errors from creeping in when a codebase is free of warnings for all configs and all targets and the toolchain is never updated. Unfortunately, none of the above is the case for the Linux kernel at this time.” 也就是说 -Werror 这种编译选项对于帮助在一个干净的代码基础上检查新增部分是否引入潜在问题是很有帮助的,但对于 Linux 来说,由于历史太过于长久,要想修复那些会引发告警的代码可不是一个短期内能完成的事情,况且内核代码已经过于庞大了。

可是固执的 Linus 先生仍然不愿意让步。"No. It was merged in response of _years_ of pain, with the last one just being the final drop. I'm not going to revert that change. I probably will have to limit it (by making that WERROR option depend on certain expectations), but basically any maintainer who has code that causes warnings should expect that they will have to fix those warnings...I spent hours yesterday getting rid of some warnings. It shouldn't be on me fixing peoples code. It shouldn't be on me noticing that people send me crap that warns. And it really shouldn't be "Linus cares about warnings, so configurations that Linus doesn't test can continue for years to have them". My "no warnings" policy isn't exactly new, and people shouldn't be shocked when I then say "time to clean up *YOUR* house too" 看上去 Linus 先生忍这个事情也不是一年两年的事情了,不知道是什么触发了老先生在 5.15 爆发了要彻底解决这个问题念头。

眼看这事情就要陷入僵持,还好 Marco Elver 在这个激烈的对话中提出了一个折衷的想法,即我们可以只在 “COMPILE_TEST” 方式下执行内核构建时启用 “-Werror”,以便将警告作为错误报告推送给那些编译测试内核的人。这个思路看上去不错,Linus 也称其为 “reasonable” 的。随着越来越多的上游开发人员表达了他们在启用 “-Werror” 上遇到了构建内核的问题。社区的意见似乎正在取得一致。

长话短说, Linus Torvalds 现在已针对自己的改动发布了新的补丁,默认情况下将仅针对 COMPILE_TEST 启用 “-Werror”。但他认为敦促开发人员承担责任并修复编译器警告的想法还是正确的。

新闻出处,“Linux 5.15’s New “-Werror” Behavior Is Causing A Lot Of Pain” https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.15-Werror-Pain

关键词: Linux

Linux 5.15 致力于全面的编译时和运行时缓冲区溢出检测

The latest security effort being pursued by Google’s Kees Cook is to provide full compile-time and run-time coverage of all detectable buffer overflows.

来自 Google 的 Kees Cook 目前致力于实现在编译期间和运行期间对缓冲区溢出问题进行检测。Linux 内核中的缓冲区溢出检测对象包括数组索引或者对 memcpy()memmove()memset() 此类函数的调用,而对 str*() 这类函数已经全面覆盖。

内核开发人员一直在努力实现这一目标,而在 Linux 5.15 中,引入了大量针对缓冲区溢出检测的改进,这包括提供了一些新的通用帮助函数以及其他底层代码的更新。Kees Cook 在提交的补丁中是这样描述的:"After this series (and the changes that have now landed via netdev and usb), we are so very close to finally being able to build with -Warray-bounds and -Wzero-length-bounds. However, due two recently found corner cases in GCC[3] and Clang[4], I have not included the last two patches that turn on these options, as I don't want to introduce any known warnings to the build. I am expecting to solve them before rc2, though, so hopefully there will be a small follow-up to this series before then." 看起来内核已经非常接近最终能够使用 -Warray-bounds-Wzero-length-bounds 进行构建。然而,由于最近在 GCC 和 Clang 中发现了两个非常棘手的问题,为了不在当前内核构建中引入过多的告警,Kees 目前还没有在正式提交中打开这些编译选项,但他希望能在 rc2 之前解决它们。让我们拭目以待吧。

新闻出处,“Linux 5.15 Working Towards Comprehensive Compile-Time & Run-Time Detection Of Buffer Overflows” https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.15-Overflows

关键词: Linux

Linux 5.15 KVM 默认启用新的 x86 TDP MMU 和 AMD SVM 5 级分页

The Linux 5.15 Kernel-based Virtual Machine (KVM) changes this cycle are quite exciting on the x86 (x86_64) front with several prominent additions.

上周 Linux 5.15 中加入了 KVM 的新功能。除了针对 ARM 和 IBM s390 的更新外,最引人注目的是针对 x86/x86_64 的改动

今年早些时候,在 Linux 5.12 周期中,曾经有过计划默认切换到新的 x86 MMU 代码,但这并没有发生 …… 经过几个内核大版本之后,改进后的 MMU 支持终于称为 Linux 5.15 的默认配置。

默认情况下,Linux 5.15 中 x86 64 位机器的新 TDP MMU 将基于新的快速且无锁的缺页处理(fast/lock-less page fault)机制实现。来自 Red Hat 的 Paolo Bonzini 评论了这一变化,"With the addition of fast page fault support, the TDP-specific MMU has reached feature parity with the original MMU. All my testing in the last few months has been done with the TDP MMU; switch the default on 64-bit machines." 看上去由于新的缺页机制的支持,TDP MMU 已经达到了原先 MMU 相同的功能,而且测试结果良好。

在过去的一年里,Google 一直在大力研究这个 TDP MMU,与典型的 KVM x86 MMU 相比,它支持更强的并行性和可扩展性。他们编写这个新 MMU 代码的动机是希望能够并行处理页面错误,从而支持那些包含了 400 多个 vCPU 和高达 12 TiB 内存的虚拟机实现实时迁移。

Linux 5.15 的 KVM x86 现在也将支持的最大 vCPU 数量从之前的 KVM_MAX_VCPUS,即 288 个提高到 1024 个,当然这是理论值,实际的代码中的配置是限制为 710 个。 针对 x86 的补丁还包括对 AMD AVIC 的优化、对 AMD 处理器上的 5 级页表的支持以及其他改进。AMD KVM 代码现在支持 5 级页表,这将用于对下一代 AMD EPYC “Genoa” 处理器的支持。

新闻出处,“Linux 5.15 KVM Defaults To The New x86 TDP MMU, Enables AMD SVM 5-Level Paging” https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.15-KVM

关键词: Linux,KVM,x86

Linux 5.15 增加了新的系统调用以更快地释放被杀死的进程的内存

To help out memory pressure / out-of-memory killing solutions like systemd-oomd or Android’s LMKD, Linux 5.15 is introducing the “process_mrelease” system call to more quickly free the memory of dying processes.

为了帮助解决内存压力,人们发明了诸如 systemd-oomd 或 Android 的 LMKD 之类解决方案,Linux 5.15 引入了一个新的 process_mrelease系统调用,可以比当前的方案更快、以更加可预测的方式回收被杀死的进程的内存。

该补丁对这个新的系统调用的解释如下:

For such system component it’s important to be able to free memory quickly and efficiently. Unfortunately the time process takes to free up its memory after receiving a SIGKILL might vary based on the state of the process (uninterruptible sleep), size and OPP level of the core the process is running. A mechanism to free resources of the target process in a more predictable way would improve system’s ability to control its memory pressure.

Introduce process_mrelease system call that releases memory of a dying process from the context of the caller. This way the memory is freed in a more controllable way with CPU affinity and priority of the caller. The workload of freeing the memory will also be charged to the caller. The operation is allowed only on a dying process.

大致的意思是说,当一个进程接收到 SIGKILL 信号的时候并不一定能及时释放自己的内存,这可能会受到很多因素的影响,譬如进程的状态(它可能是处于 uninterruptible sleep 态)、正在运行进程的的 core 的 OPP 级别等。而通过调用这个新的 process_mrelease() 系统调用,它会在调用者的上下文中释放被杀死的进程的内存。这种方式下,内存的释放更可控,因为它直接在当前 CPU 上运行,只取决于调用者任务的优先级大小。

新闻出处,“Linux 5.15 Adds New Syscall To More Quickly Free Memory Of Dying Processes” https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.15-process-mrelease

关键词: Linux,process_mrelease

联系我们

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

tinylab wechat



Read Album:

Read Related:

Read Latest: