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

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

泰晓资讯·12 月 / 第一期 / 2023

unicornx 创作于 2023/11/30

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

Linux 内核最新消息

Linus Torvalds 在本周初发布了 Linux 6.7 内核的第三个每周 RC 版本。

考虑到这段时间恰逢美国感恩节假期,本周发布的 Linux 6.7-rc3 中的改动并不是很多。Linus Torvalds 在 6.7-rc3 公告中写道:

“The diffstat here is dominated by a couple of reverts of some Realtek phy code (accounting for almost a third of the diff).

But ignoring that, it’s mostly fairly small, and all over the place. Ethernet drivers, smb client fixes, bpf selftests stand out as bigger areas, but we have random small driver updates (block, gpu, nvme, hid, usb) and some arch fixes (x86, parisc, loongarch, arm64) too. Some misc filesystem fixes.”

Linux 6.7 周期的剩下的几个 RC 的表现将取决于圣诞节假期前后的表现,Linux 6.7 稳定版按计划将在 2023 年的最后几天发布,但考虑到假期可能会推迟到明年 1 月初。

Linux 6.7 提供了许多新功能,包括主线 Bcachefs 文件系统支持、对 Intel Meteor Lake 集成显卡的支持升级为稳定版、Nouveau 驱动程序中的 NVIDIA GSP 固件支持、移除 Intel Itanium 支持等。

https://www.kernel.org/ updated by 2023/11/30

分支类型版本发布时间
mainline6.7-rc32023-11-27
stable6.6.32023-11-28
stable6.5.13 [EOL]2023-11-28
longterm6.1.642023-11-28
longterm5.15.1402023-11-28
longterm5.10.2022023-11-28
longterm5.4.2622023-11-28
longterm4.19.3002023-11-28
longterm4.14.3312023-11-28
linux-nextnext-202311292023-11-29

关键词: Linux

Linux 内核开发人员针对一项基于优先级实现关机功能展开讨论

A Linux kernel mailing list discussion this holiday weekend that is seeing polarized views on the matter is around a new patch series proposed priority-based shutdown support for drivers/hardware.

上周的 Linux 内核邮件列表讨论中,人们围绕着一个新的补丁系列,产生了两极分化,展开了激烈的讨论。这个补丁提议在驱动程序中实现基于优先级的方式关闭硬件。

来自 Pengutronix 嵌入式 Linux 咨询公司的 Oleksij Rempel 周五提交了这个补丁系列,以添加基于优先级的关闭硬件的功能。改特性的主要目的是在主线 Linux 内核中提供优先关闭特定设备的能力,例如在断电的情况下。这种基于优先级的关机支持似乎是由汽车 Linux 行业推动的,在汽车 Linux 行业中,这样的软件解决方案在断电等场景中至关重要,如果处理不当,可能会发生硬件损坏。

在补丁系列中,这种基于优先级的设备关机支持侧重于在意外突发关机事件(如电源电压下降或完全断电)期间正确关闭关键设备。作为补丁系列的一部分,还在关机阶段将 (e)MMC 存储设备设置为更高的优先级,其目的是避免数据损坏,确保数据完整性。

在理论上这种基于优先级的关机支持似乎看上去很不错,譬如某些设备/驱动程序有充分的理的话,可以抢先关闭电源,从而防止数据丢失或避免其他问题。但在实践中,当可能有多个驱动程序在关闭过程中声称希望获取 “优先权”时,就更难同时满足了,并且在如何确保可靠的设计并正确解决实际问题方面存在其他障碍。

Greg Kroah-Hartman 首先对这种基于优先级的关机支持提出了质疑。Greg 的评论原文如下:

Oh fun, now we will have drivers and subsystems fighting over their priority, with each one insisting that they are the most important!

/s

Anyway, this is ripe for problems and issues in the long-run, what is so special about this hardware that it can not just shutdown in the existing order that it has to be “first” over everyone else? What exactly does this prevent and what devices are requiring this?

And most importantly, what has changed in the past 20+ years to suddenly require this new functionality and how does any other operating system handle it?”

此后,支持和反对双方都有很多回复,讨论还涉及主线 Linux 内核是否应该具有这样的功能来有效地解决现有硬件设计上的问题。事实证明,一些用于汽车行业的树外 Linux 内核版本已经提供了这种优先关机支持。Oleksij Rempel 将需求总结为:

“It prevents HW damage. In a typical automotive under-voltage labor it is usually possible to reproduce X amount of bricked eMMCs or NANDs on Y amount of under-voltage cycles (I do not have exact numbers right now). Even if the numbers not so high in the labor tests (sometimes something like one bricked device in a month of tests), the field returns are significant enough to care about software solution for this problem.

Same problem was seen not only in automotive devices, but also in industrial or agricultural. With other words, it is important enough to bring some kind of solution mainline.”

Greg 后来打趣道,”So hardware is attempting to rely on software in order to prevent the destruction of that same hardware? Surely hardware designers aren’t that crazy, right? (rhetorical question, I know…)”

还有人提出了为什么这样的功能不能在用户空间中实现,以及其他想法。感兴趣的人可以查看内核邮件列表中该主题下的讨论。到目前为止,对这种方法存在非常不同的意见,现阶段是否可以设计出一个合适的解决方案,既能满足主线的需求,又能满足汽车和更广泛的嵌入式/工业空间的需求,还有待观察。

新闻出处,“Linux Kernel Developers Debate Priority-Based Shutdown Support”: https://www.phoronix.com/news/Linux-Priority-Based-Shutdown

关键词: Linux

基于当前 Linux 6.7 实时 “RT” 补丁已更新

Released on Thursday were the Linux v6.7-rc2-rt1 real-time “PREEMPT_RT” patches that now re-bases the RT patches against the in-development Linux 6.7 kernel series.

周四发布的了 Linux v6.7-rc2-rt1 实时 “PREEMPT_RT” 补丁,RT 补丁已经 rebase 到正在开发的 Linux 6.7 内核系列。

v6.7-rc2-rt1 是 Linux 6.7 补丁从之前的 v6.6-rt15 以来首次升级了基线。除了进行更改以适应 Linux 6.7 的更改外,新补丁系列中没有对功能上有新的更改。

目前,基于 Linux 6.7 的实时补丁系列有 90 个补丁。但是,大部分补丁都很简单,譬如有的补丁仅用于将新的 Kconfig 选项添加到每个支持的 CPU 架构中。其他的补丁包括使能实时内核构建的情况下需要对单个驱动程序进行的各种其他小更改。

在实时补丁最终可以完全上游之前,剩下的主要工作围绕着线程原子/非阻塞控制台的持续工作。这项工作仍在继续,希望能在 2024 年完全准备就绪,以便实时补丁在经过多年维护后最终能够被完全合入主线。

新闻出处,“Real-Time “RT” Patches Updated Against Current Linux 6.7 Development”: https://www.phoronix.com/news/Linux-6.7-Real-Time-RT-Patches

关键词: Linux, PREEMPT_RT

Linux 6.8 希望升级其 zstd 代码以获得更好的压缩性能

Back in Linux 6.2 the in-kernel Zstd compression/decompression code was updated against the Zstd 1.5 upstream state. Now for the Linux 6.8 kernel in the new year the plan is for updating to Zstd 1.5.5 that should provide better compression performance.

早在 Linux 6.2 中,内核 Zstd 压缩/解压缩代码已更新到 Zstd 1.5。现在,对于明年的 Linux 6.8 内核,计划更新到 Zstd 1.5.5,这将提供更好的压缩性能。

虽然遗憾地错过了最近关闭的 Linux 6.7 合并窗口,但来自 Meta 的 Nick Terrell 最近发送了一组内核补丁,用于更新 Linux 内核中 Zstd 代码以追上 Zstd 上游 1.5.5 的状态。内核中的这个 Zstd 代码被各种文件系统驱动程序用于透明文件系统压缩/解压缩,将各种内核资产压缩成 Zstd 格式等。 Intel 希望在 Linux 内核中使用更新的 Zstd 版本,因为它公开了 Zstd 的外部匹配提供程序 API,进而允许 QuickAssist 技术 (QAT) 加速 LZ 的匹配查找。这对于那些希望将 QAT 硬件或 QAT 加速集成到 Xeon Sapphire Rapids 和即将推出的 Emerald Rapids 处理器中的人来说是个好消息。

除了为满足 Intel 的需求而添加的 API 外,内核中更新的 Zstd 代码也已经过测试,发现基于最新 Zstd 的写入和压缩时间缩短了约 6%。但是,读取和解压缩时间的时间略有增加。Zstd 1.5.5 本身于 4 月发布,其中包含一些性能改进、修复和其他更改。

Linux 内核的 Zstd 1.5.5 支持计划在 Linux 6.8 合并窗口中完成其提交工作。

新闻出处,“Linux 6.8 Looks To Upgrade Its Zstd Code For Better Compression Performance”: https://www.phoronix.com/news/Zstd-1.5.5-Patches-Linux-Kernel

关键词: Linux, Zstd

Linux 内核维护者反对为 64 位 ARM Linux 内核合入针对 CPU 的特定优化

While micro-architecture specific optimizations are rather common place within the Linux x86_64 kernel for various Intel and AMD CPU families with various performance tricks, the ARM64 Linux kernel maintainers are against introducing new micro-architecture specific optimizations as it affects new ARM processors.

虽然在支持各种 Intel 和 AMD CPU 系列的 Linux x86_64 内核中,为了提高性能,特定于微架构的优化相当常见,但 ARM64 Linux 内核维护者反对引入新的特定于微架构的优化,因为它会影响新的 ARM 处理器。

Ampere Computing 发布了一组 4 个补丁,为其新的 AmpereOne 服务器处理器提供优化。Ampere Computing 发现,当使用 4K 页面大小时,这些新的高核心数 ARM 服务器处理器可以从积极的提前读取中受益。据报道,针对顺序读取性能测试,HugeTLB 或 Tmpfs 的收益高达 1.3 ~ 1.4 倍。

虽然这些收益对于提高 AmpereOne Linux 性能来说令人兴奋,但看起来这项工作不会被主线 Linux 内核收录。

著名的 ARM Linux 内核开发人员 Will Deacon 是这样评论特定于 AmpereOne CPU 的性能增强补丁的:

“We tend to shy away from micro-architecture specific optimisations in the arm64 kernel as they’re pretty unmaintainable, hard to test properly, generally lead to bloat and add additional obstacles to updating our library routines.

Admittedly, we have something for Thunder-X1 in copy_page() (disguised as ARM64_HAS_NO_HW_PREFETCH) but, frankly, that machine needed all the help it could get and given where it is today I suspect we could drop that code without any material consequences.

So I’d really prefer not to merge this; modern CPUs should do better at copying data. It’s copy_to_user(), not rocket science.”

ARM 的 Mark Rutland 也同意 Deacon 的说法,并赞同删除 Thunder-X1 目标优化。内核开发人员 Marc Zyngier 也同意这一点,并且已经在开发一个补丁来删除 Thunder-X1 特定的代码。

因此结论是,社区倾向于提高代码的可维护性而避免使得 ARM64 Linux 内核代码过于复杂,特定于 CPU/微架构的优化不是内核社区追求的目标。我们更乐意看到那些专注于 ARM Linux 的发行版自己打上此类补丁,或者任何 AmpereOne 优化的 Linux 发行版来做这件事,特别是考虑到 Ampere 专注于高性能和高能效的 ARM Linux 服务器,所以他们自己需要去关注这些优化,特别地他们的目标是与 AMD EPYC 和 Intel Xeon 服务器竞争。

新闻出处,“64-bit ARM Linux Kernel Against CPU-Specific Optimizations: “Pretty Unmaintainable””: https://www.phoronix.com/news/ARM64-Linux-No-Uarch-Opts

关键词: Linux, ARM

Linux 6.8 中将引入开源的 Imagination PowerVR GPU 驱动程序

It’s been well over a decade since many were wanting open-source Imagination PowerVR graphics when their graphics IP was more common among SoCs, but with the Linux 6.8 kernel in early 2024 there will finally be an upstream, open-source PowerVR DRM kernel graphics driver! But before getting your hopes too high, this is the effort that’s only around the newer PowerVR graphics and not the prior generation hardware from many years ago.

十多年来,随着 Imagination 的 PowerVR Graphic IP 在 SoC 中更为普遍时,许多人一直希望 Imagination 为 PowerVR 显卡开源。随着 2024 年初的 Linux 6.8 内核的发布,最终我们在上游主线中将看到开源的 PowerVR DRM 内核图形驱动程序!但请不要寄予太高的期望,因为这些改动指针对较新的 PowerVR Graphic,而不是多年前的上一代硬件。

在过去的几年里,Imagination Tech 一直在为 Direct Rendering Manager(DRM)子系统开发开源的 GPU 内核驱动程序。这个开源 PowerVR 内核驱动程序与 Mesa 内部正在开发的 PowerVR Vulkan 驱动程序同时及逆行。Imagination 一直在开发这个开源内核驱动程序和开放的 Vulkan 驱动程序,以更好地在 Linux 上提供 3D 支持。对于 OpenGL,该公司计划使用 Zink OpenGL-on-Vulkan 实现。

此 Imagination DRM 驱动程序的开发最初主要集中在 AXE-1-16M GPU 上,并使用 TI SK-AM62 板进行测试。内核驱动程序也已通过 BeaglePlay 开发板的测试。

BeaglePlay 是一款售价在 100 美元左右的开发板,配备 TI AM625 SoC,具有四个 Cortex-A53 内核、一个 400MHz Cortex-M4F 和 PowerVR Rogue AXE-1-16M GPU。该主板具有 2GB DDR4 内存和 16GB eMMC 闪存。从硬件的角度来看,这并不是特别令人兴奋,除非你只是想测试这个开源的 PowerVR 驱动程序。

此 Imagination PowerVR Rogue GPU 内核驱动程序是从头开始编写的开源驱动程序,支持 DMA-BUF / PRIME、DRM 同步对象、per-context 的用户空间托管虚拟地址空间、电源管理、GPU 作业提交、GPU 挂起恢复和其他基础功能。

今年感恩节得到的消息是,经过几轮审查(v9),今天的补丁是通过 DRM-misc-next 发送到 DRM-Next。随着 PowerVR DRM 驱动程序成为这个 drm-misc-next PR 的一部分,它现在有望在即将到来的 Linux 6.8 内核周期中被合入内核主线。

如果不出意外的话,Imagination PowerVR Rogue 内核图形驱动程序将在 Linux 6.8 中与 Mesa PowerVR Vulkan 驱动程序一起出现。

新闻出处,“Imagination PowerVR Open-Source GPU Driver To Be Introduced In Linux 6.8”: https://www.phoronix.com/news/Imagination-PVR-Linux-6.8-DRM

关键词: Linux, Imagination, PowerVR, GPU

联系我们

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

tinylab wechat



Read Album:

Read Related:

Read Latest: