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

泰晓RISC-V实验箱,不会吃灰,开箱即用
请稍侯

泰晓资讯·4月 / 第二期 / 2020

Wang Chen 创作于 2020/04/10

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

Linux Kernel 5.6 小版本相继发布

继 3 月 29 日 Linus 发布了 5.6 的正式版后不久, 5.6.1 作为新系列的第一个小版本发布,增加了 27 个更改,其中 148个 插入,103 个删除。大多数修复有关各种 USB 和驱动程序,同时支持了 ASKEY WWHC050,BroadMobi BM806U 和 Wistron Neweb D19Q1 设备。具体参考 https://lkml.kernel.org/lkml/20200401140511.GB2427801@kroah.com/。

不到 24 小时之后,5.6.2 就发布了。Linux 5.6.2 仅对 VT 代码进行了一些修复,但值得注意的是,它包含了 mac80211 修复,用于修复 5.6 中工作不正常的 Intel “IWLWIFI” 无线驱动程序。这个补丁错过了 5.6.1,但现在已经在 5.6.2 中了。具体参考 https://lkml.kernel.org/lkml/20200402062620.GA2678935@kroah.com/。

关键词: Linux,5.6.1,5.6.2

针对匿名页的进一步改进

The kernel’s memory-management subsystem goes to great lengths to keep the pages that are actually in use in memory. But sometimes it gets things wrong, leading to reduced performance or, in the worst cases, flat-out thrashing. We may be about to see a significant improvement, though, thanks to a patch set from Joonsoo Kim changing how anonymous pages (those containing data not backed by files on disk) are managed. As it turns out, all that had to be done was to make use of some work that already exists in related parts of the memory-management code.

内核中的内存管理子系统竭尽全力确保那些正在使用的物理页保持在内存之中。如果做不到的话会导致性能下降,最坏情况下还会导致内存大量换入换出。得益于 Joonsoo Kim 提交的一个补丁,我们很可能很快就能看到在这个方面的巨大改善。这个补丁改变了 anonymous page 的管理方式。

Kim 的补丁主要是统一了 anonymous pages 和 file-backed pages 的处理方式。首先,缺页异常发生后,anonymous pages 也先加入 inactive list。如若这些页面真的很有用,那么就会在 soft fault 发生的时候提升到 active list 去;否则的话就可以更快的被回收掉。另一个改动是关于 refault tracking。目前的内核中,refault tracking 只会对 file-backed LRU list 进行。而 Kim 的补丁则对匿名页的 LRU list 也增加 refault tracking 机制。

Kim 提供了一些测试数据,感觉非常不错,这不禁使得内存管理子系统的主要维护人员 Andrew Morton(也是当初为 file-backed pages 实现上述机制的开发人员)对自己当初为啥没有将这些机制统一感到有点不好意思(原话是: “One wonders why on earth we weren't doing these things in the first place?”

目前在内存管理社区中似乎没有看到什么反对意见。但这并不意味着就能很快合入了,和内存管理有段的补丁通常需要经过无数测试以及审核,开发者们才有信心合入。估计是进不去 5.7 版本了,但相信不久之后应该会能进入主线。

这篇文章涉及了页框回收中和 LRU lists 相关的一些背景知识,为了方便大家阅读,nice 的作者在文章的第一部分专门开辟了一大块篇幅介绍了 Linux 中有关 LRU lists 的发展历史,如果你对这块不太熟悉,建议阅读一下原文 “Working-set protection for anonymous pages”

“泰晓科技” 的 “LWN 中文翻译计划” 针对内存的页框回收也收集了一些好文,感兴趣的同学可以点击 这里 ,阅读其中的 “1.8 Page replacement algorithms (Page replacement)” 部分。

关键词: Linux,内存管理,匿名页

io_uring 的发展新动向

The io_uring subsystem has, in the last year, redefined how asynchronous I/O is done on Linux systems. As this subsystem grows in both capability and users, though, it starts to run into limitations in the types of operations that can be expressed. That is driving a number of changes in how operations are programmed for io_uring. One example is the mechanisms considered for carrying a file descriptor between operations that was covered here in early March. Another has to do with how I/O buffers are chosen for operations.

io_uring 子系统在过去的一年里重新定义了 Linux 系统中异步 I/O 的使用方式并取得了很大的进步。但这并没有阻碍该子系统的进一步发展。一个例子是在我们在 上个月的第四期 中给大家介绍的利用 io_uring 机制建立一个包含 openat()read()close() 系统调用的队列加速读文件的操作。另一个例子就是这里给大家介绍的一个新补丁。

考虑一下传统模式中调用 poll() 实现多路复用的场景,当 poll() 返回时我们可以判断哪些描述符已经就绪,然后对就绪的文件逐个调用读写操作执行实际的 I/O。如果使用 io_uring 来优化的话,就是针对每个文件描述符把这些异步 I/O 操作加入队列实现批处理。

这种方式确实可以减少系统调用的发生,但缺点是需要为每个队列中的读写操作都分配一个单独的缓冲区,尽管其中许多操作可能由于无法就绪所以在未来一段时间内都无法实际被执行到。对于那些需要等待许多读写操作的应用程序来说,会导致内存使用量大大增加。

为了解决这个问题 io_uring 开发者 Jens Axboe 最终选择的方案是让应用程序向 io_uring 提供一个或多个 buffer pool,当需要缓冲区时,由 io_uring 自己从 pool 中挑选一个 buffer 使用。

这项工作还没有合入 linux-next 中,不过很可能这个功能可以被包含在 5.7 的开发周期之中。这样对 io_uring 的操作会变得更加灵活。更多详细介绍请阅读原文 “Automatic buffer selection for io_uring”

关键词: Linux,io_uring

微软宣布启动 IPE 项目,解决 Linux 系统完整性问题

Microsoft’s embracing of Linux continues, and the company’s latest project sees it trying to improve the security and integrity of systems. The Windows-maker has launched a Linux Security Module (LSM) called Integrity Policy Enforcement (IPE).

The kernel add-on gives administrators the option of configuring policies that can enforce integrity requirements across an entire system. It is possible to create a list of binaries that are permitted to run, and specify attributes that need to be checked before execution is allowed.

微软继续加强对 Linux 的支持,该公司的最新项目表明,微软正试图提高 Linux 系统的安全性和完整性。这家以 Windows 闻名的操作系统公司已经推出了一个名为 “完整性策略执行(Integrity Policy Enforcement,简称 IPE)” 的 Linux 安全模块(LSM)。

这个附加的内核组件允许系统管理员执行一些配置策略,对整个系统强制执行完整性检查。它还允许我们创建授权允许运行的可执行文件的列表,并指定在允许其执行之前需要检查哪些属性。

Microsoft 在设计 IPE 时并未考虑适用于所有的 Linux 系统。而是仅针对一些专用的设备,例如一些定制的嵌入式系统,譬如数据中心中的网络防火墙设备等。Microsoft 提供 IPE 的想法是尽可能消除系统中不确定的因素,以帮助进一步增强安全性。

关键词: Microsoft,Linux,IPE

Qt 公司发布 2020 年路线图

The Qt Company has made public their 2020 road-map for Qt software releases. The highlights of their 2020 road-map include:

  • Qt Design Studio 1.5 is to release in May.
  • Qt 5.15 is still on track for release in May.
  • Further Qt Design Studio improvements for this 2D/3D design tool will continue in H2.
  • Qt Creator is working on C++20 support as well as improvements to Python and QML coverage.
  • Qt for Microcontrollers (Qt for MCUs) is one of the newest areas of focus at The Qt Company and they are working on improving the tools and capabilities of it over the calendar year.
  • The Qt Company is still committing to having Qt 6.0 ready to ship at the end of the year.
  • The Qt Automotive Suite is preparing to leverage Qt 5.15 LTS.
  • Continuing to work on the Qt Marketplace with better integration and features.

More details at the Qt.io blog. This road-map comes a few months after The Qt Company made various commercial changes including restricting LTS benefits to commercial customers, requiring Qt Accounts for binary package downloads, and other changes.

Qt 公司已公开其 2020 年 Qt 软件版本的路线图。2020 年路线图的重点包括:

  • Qt Design Studio 1.5 将于 5 月发布。
  • Qt 5.15 仍有望在五月份发布。
  • Qt Design Studio 对 2D/3D 设计工具的进一步改进将在 H2 中继续进行。
  • Qt Creator 正在开发对 C++ 20 标准的支持以及对 Python 和 QML 的改进。
  • Qt for 微控制器(Qt for MCU)是 Qt 公司的最新重点领域之一,他们正在努力在年内对其工具和功能进行改进。
  • Qt 公司仍致力于在今年年底前准备好发布 Qt 6.0。
  • Qt Automotive Suite 正在准备利用 Qt 5.15 LTS。
  • 在 Qt Marketplace 上提供更好的集成和功能。

更多详细信息,请访问 Qt 博客

关键词: Qt,Roadmap

联系我们

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

tinylab wechat



Read Album:

Read Related:

Read Latest: