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

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

泰晓资讯·9月 / 第四期 / 2020

Wang Chen 创作于 2020/09/25

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

Linux 内核最新动态

The current development kernel is 5.9-rc5, released on September 13. Linus said: “So aside from the smoke from the fires, and a performance regression I’m still looking at, things look normal.”

One not-entirely-normal change that hit the mainline after the 5.9-rc5 release was the abrupt removal of the “soft scrollback” code from the fbcon and vgacon console drivers. This feature, which allows the user to page backward through output written directly to the console, was once an indispensable part of the Linux experience, but it has fallen into disuse and lacks a maintainer now. The disclosure of a security vulnerability in the fbcon code was the last straw; a vgacon vulnerability has also since been reported.

This change is not universally popular; Pavel Machek described it as “a way for Linus to find a maintainer for the code”. Should such a maintainer materialize (and Machek has said he would do it), the scrollback feature might yet be restored.

Stable updates: 5.8.9, 5.4.65, 4.19.145, 4.14.198, 4.9.236, and 4.4.236 were all released.

小编最近比较关心 RISC-V,所以以后会不定期地总结一些 RISC-V 在内核中的动态给大家,最近有两条:

- "Unify NUMA implementation between ARM64 & RISC-V":<https://lwn.net/Articles/831457/> - "riscv: Add vector ISA support": <https://lwn.net/Articles/831189/>

**关键词**: Linux, RISC-V

听说内核将抛弃 Tasklet

Tasklets offer a deferred-execution method in the Linux kernel; they have been available since the 2.3 development series. They allow interrupt handlers to schedule further work to be executed as soon as possible after the handler itself. The tasklet API has its shortcomings, but it has stayed in place while other deferred-execution methods, including workqueues, have been introduced. Recently, Kees Cook posted a security-inspired patch set (also including work from Romain Perier) to improve the tasklet API. This change is uncontroversial, but it provoked a discussion that might lead to the removal of the tasklet API in the (not so distant) future.

熟悉 Linux 内核开发的同学应该都了解过 Tasklet,它为 Linux 内核提供了一种有趣的任务同步机制,可以允许我们在中断处理的下半部中安排一些可延迟执行的任务。虽然 tasklet 这种机制被某些人所诟病,但是自其从 2.3 版本开始进入内核主线后,一直存在至今,即使后来又引入了了其他的下半部机制,譬如工作队列等,但都没有让社区舍得丢弃它。可是就在最近,Kees Cook 在 Romain Perier 的帮助下提交了一个补丁集,以改进 tasklet 的 API,具体补丁修改参考 https://lwn.net/ml/kernel-hardening/20200716030847.1564131-1-keescook@chromium.org/。 这项改进并没有引起什么争议,但是却触发了额外的讨论,而且讨论的结果可能会导致在不久的将来删除 tasklet API。更详细的讨论内容请阅读 LWN 原文 “Modernizing the tasklet API” (https://lwn.net/Articles/830964/)。

关键词: Linux,Tasklet

来自 “LPC 2020” 大会上有关 Android 内核的报道摘要

In its early days, the Android project experienced a high-profile disconnect with the kernel community. That situation has since improved considerably, but there are still differences between Android kernels and the mainline. As a result, it is not possible to run Android on a vanilla kernel. That situation continues to improve, though; much evidence to that effect was on display during the Android microconference at the 2020 Linux Plumbers Conference. Several sessions there showed the progress that is being made toward unifying the Android and mainline kernels — and the places where there is still some work to be done.

(注:由于小编最近对 Android 比较感兴趣,所以这篇报道翻译得比较仔细,希望对大家了解 Android 的最新动态有帮助)

过去,Android 项目与内核社区之间的割裂问题一直广受关注。但随着时间的推移,这种情况有了很大的改善,但是 Android 的内核和 Linux 主线之间仍然存在差异,这导致我们无法在普通内核上运行 Android 系统。 但是,这种情况正在继续改善。在 2020 Linux Plumbers Conference 的 Android 分会场上,大量的介绍显示了在统一 Android 和主线内核这项工作上正在取得的进展,虽然仍有很多工作要做。

Todd Kjos 首先介绍了 Android Generic Kernel Image(GKI)的工作。大家知道 Google 一直在维护着一个 Android Common kernel,时刻保持着对 Linux 主线内核的跟踪,这个 Android Common Kernel 在 upstream 内核的基础上打上了 Android 特有的补丁,所以说这个 Common Kernel 和 Linux 主线内核并不是保持一致的。Vendor(这里指芯片供货商,譬如 Quacomm、MTK) 和 OEM 厂家(最终发布手机产品的厂家,譬如小米,OPPO)将继续基于这个 Andorid Common Kernel 添加其私有的修改,导致最终的每种产品都有自己的内核,这也意味着市面上实际有数千种不同的 “Android” 的 Linux 内核 在流通。这种碎片化现象几近让人奔溃,不仅使我们非常难以确保所有设备都运行最新内核,甚至很难确保它们都能获得安全更新。一旦新的 Andorid Platform 版本发布(譬如从 Q 升级到 R)并要求使用新的 Linux 内核时,对现有设备的升级也需要花费更多时间。从另一方面来说,这也造成 Vendor 和 OEM 所做的 fix patch,通常也不会很容易地被合入到 mainline,这让情况变得更糟。

目前 Google 的解决方法是由 Google 出面提供一个所有设备都能使用的以二进制形式发布的通用内核,即所谓的 General Kernel Image(GKI)。任何还没有合入 mainline kernel 中的 vendor/OEM 代码或者设备特有的代码都只能以 kernel module 的形式加载到 GKI 中。这么做的好处是一方面所有的设备将使用一个干净的统一的内核,同时也会迫使更多 vendor 积极地将他们的代码改动提交到 upstream 中去。

目前 Android 11 的发布还是基于 Android Common Kernel 的方式。但从 Android 12 开始将强制要求改用 GKI 方式出货。会上有人问,如果 Vendor 的确有一些 patch 没有被集成到 mainline 或 Android Common Kernel 中,厂商应该如何应对。Kjos 回答说,目前的计划是通过 tracepoints 添加 vendor hook,具体细节还在制定中。

Matthias Männich 介绍了 Google 如何确保 GKI 的 ABI 接口稳定的问题,这样一旦 GKI 升级也不会给已经发布的设备带来升级问题。这不是一个简单的任务,内核 ABI 非常多,很难及时发现某一部分发生了变化。他强调指出,这项工作绝不是针对 mainline kernel 的 ABI,也不是针对 LTS kernel 的 API,它只是想让 kernel ABI 在给定的 Android 版本中保持稳定。

Sumit Semwal 介绍的话题是关于如何在 mainline kernel 上启动 Android 系统。他发现,如果不考虑特殊的硬件需求,目前只需要一个补丁(anonymous VMA naming)就可以了。当然,在真实硬件上,情况会变得复杂。他说,理论上来说,Android 系统可能只需要一个 mainline kernel patch 就能启动,但 Android kernel 在 5.9-rc kernel 的基础上仍然额外增加了 485 个 patch。其中约 30 个目前正在讨论是否可以合入 mainline,78 个有计划提交给 upstream。另外 25 个正在由 Linaro 进行开发,希望日后能进入 upstream。有 54 个 patch 最终会被其他替代方案取代,包括人们讨论很多次的 ION memory allocator。剩下的 260 个补丁目前还没有明确看到有 upstream 的计划。其中许多 patch 与 GKI build 或 configuration change 有关。

目前围绕 upstream 工作最活跃的讨论集中在 inline encryption(已合入 5.9 版本)和 incremental filesystem 等功能上。incremental filesystem 是一项重要的 Android 功能,Paul Lawrence 专门为这功能举行了一次简短的会议,给大家做了相关介绍。提供 incremental filesystem 的目的是允许新下载的应用能立即启动,哪怕应用下载的过程还没有完成。为了实现这一点,正在下载的文件需要显得好像它们已经存在于设备上一样,也就是说如果读取这个文件时所需的 block 已经下载好了,就可以成功读取出来;否则的话应用程序只能继续等待,直到这些 block 被下载下来。这项工作在 2019 年首次发布到 mailing list 中,但并未得到太多有意义的回复。预计在不久的将来会有新的版本提出来,因为 Android project 正在努力将这项功能纳入 mainline kernel。

原文请阅读 “Android kernel notes from LPC 2020” (<https://lwn.net/Articles/830979/>)。

关键词: Linux,Android, GKI

GCC 正添加对 BPF 的支持

The BPF virtual machine is being used ever more widely in the kernel, but it has not been a target for GCC until recently. BPF is currently generated using the LLVM compiler suite. Jose E. Marchesi gave a pair of presentations as part of the GNU Tools track at the 2020 Linux Plumbers Conference (LPC) that provided attendees with a look at the BPF for GCC project, which started around a year ago. It has made some significant progress, but there is, of course, more to do.

BPF 在内核中的使用越来越广泛,但是直到最近,它才引起 GCC 的注意。BPF 当前使用 LLVM生成。Jose E. Marchesi 在 2020 年 Linux Plumbers Conference(LPC)上代表 GNU Tools 项目为参会者介绍了 GCC 对构造 BPF 得支持,这项工作开始于一年前,目前已经取得了一些重大进展,当然还有更多的工作要做。

根据 Jose 的描述,该项工作分为三个阶段。首先是为 GNU 工具链添加 BPF target。下一步是确保生成的 BPF 程序可以通过内核的验证,以便可以将其加载到内核中。 Marchesi 说,在这一步上还有很多工作要做,因为 BPF 领域发展得实在是太快了。 最后一个阶段是为BPF 开发人员提供其他相关工具,不仅仅是编译器和汇编器,还包括例如调试器和模拟器。

更多精彩介绍,请阅读原文 “BPF in GCC” (https://lwn.net/Articles/831402/)

**关键词**: GCC,BPF

汇聚 4.5 万开发者,华为 MindSpore 1.0 正式发布

9 月,在华为全联接大会上,MindSpore 正式发布 v1.0.0 版本。自 2020 年 3 月 28 日,MindSpore 正式开源 6 个月以来,MindSpore 收获了 4.5w+ 名开发者,累计 PR 数 1w+,下载使用用户遍布全球,覆盖亚洲、欧洲、南美、北美、非洲、等各地区,MindSpore Study Group(简称 MSG)启动 4 个月便在海内外多个城市顺利开展,深圳、杭州、苏州、上海、俄罗斯、新加坡、印尼均已建立 MSG 组织,做到了真正的全球化社区。

更多讯息请阅读 mindspore 官网新闻报道:<https://www.mindspore.cn/news/newschildren?id=262>。

**关键词**: Huawei,MindSpore

阿里推出了开源的 JDK !

这里给大家介绍的 Alibaba Dragonwell 是一款免费的, 生产就绪型 Open JDK 发行版,提供长期支持,包括性能增强和安全修复。阿里巴巴拥有最丰富的 Java 应用场景,覆盖电商,金融,物流等众多领域,世界上最大的Java用户之一。Alibaba Dragonwell 作为 Java 应用的基石,支撑了阿里经济体内所有的 Java 业务。Alibaba Dragonwell 完全兼容 Java SE 标准,您可以在任何常用操作系统(包括 Linux、Windows 和 macOS)上开发 Java 应用程序, 运行时生产环境选择 Alibaba Dragonwell。产品主页:https://www.aliyun.com/product/dragonwell

**关键词**: Alibaba,Dragonwell, JDK

Eclipse 重出江湖,Theia 1.0 发布!

Eclipse 基金会年初推出 Eclipse Theia 1.0 稳定版不知有多少同学已经尝过鲜了。Eclipse 可是宣称将其作为一款可以代替 Visual Studio Code 的真正开源的方案来全心打造的(a True Open Source Alternative to Visual Studio Code)。官方提到 Theia 可以作为 Visual Studio Code 的替代方案,因此其界面也和 Visual Studio Code 极为相似。更重要的是,Theia 原生支持 Visual Studio Code 扩展协议,也就是说我们可以在 Theia 上安装和重用 Visual Studio Code 扩展。另外一个特点是 Theia 完全由非营利性且供应商中立的 Eclipse 基金会主导,并由多元化社区进行开发,不会因单一供应商的决定而损害多元化社区的利益。

官方发布网站地址:<https://projects.eclipse.org/projects/ecd.theia/releases/1.0.0>。

**关键词**: Eclipse,Theia

联系我们

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

tinylab wechat



Read Album:

Read Related:

Read Latest: