Linux 6.5 was released
Summary: This release includes initial USB4 v2 support; support for moving a mount beneath the top mount; a new cachestat(2) system call to get the cache state of files; support for unaccepted memory in virtualized guests; initial support for Scope-based Resource Management and other compiler improvements; {{{memfd_secret(2)}}} has been enabled by default; and support for MIDI 2.0. As always, there are many other features, new drivers, improvements and fixes.
Allow to move mounts beneath top mount
Some modern Linux distributions distribute packages in a way that there is a base distro layer with the usual Linux directories such as {{{/etc}}} or {{{/usr}}}, then users can install packages that provide a "layer" that incorporates content to these directories.
Updating one of those packages require incorporating a new mount to user processes, and removing the old. This can be done but it's currently too complex and has some limitations. This release exposes the ability to add a mount beneath the topmost mount of a mount stack through the new {{{MOVE_MOUNT_BENEATH}}} flag for the {{{move_mount(2)}}} system call, then the old mount can be unmounted, and users get either the old or the new mount, but never the ones below. This allows userspace to seamlessly upgrade mounts.
For more details, see this
Also, see the merge commit explanation this commit
New cachestat(2) system call to get the cache state of files
The only way to query the page cache state of large file sets and directory trees is currently {{{mincore(2)}}}, but it scales poorly. Yet, this information could come in handy: A database could decide whether to perform an index scan or direct table queries based on the in-memory cache state of the index. Performance issues of the writeback algorithms and tuning could be diagnosed. IO fulfilled by page cache (and IO to be done) within a range of a file could be estimated, allowing for more frequent syncing when and where there is IO capacity, and batching when there is not
This release includes a {{{cachestat}}} system call that queries cache state of a file and summarizes the number of cached pages, number of dirty pages, number of pages marked for writeback, number of (recently) evicted pages, etc. in a given range.
Recommended LWN article: Checking page-cache status with cachestat()
Support for unaccepted memory
UEFI Specification version 2.9 introduces the concept of memory acceptance: some Virtual Machine platforms, such as Intel TDX or AMD SEV-SNP, requiring memory to be accepted before it can be used by the guest. Accepting happens via a protocol specific for the Virtual Machine platform. This release adds support for it.
Recommended LWN article: Seeking an acceptable unaccepted memory policy
Initial support for Scope-based Resource Management and other compiler improvements
This release adds the infrastructure necessary to incorporate some compiler extensions that help to automatically run functions on a variable when its type goes out of scope, which can help to reduce bugs.
There is also initial support for the {{{__counted_by}}} macro, which will allow to provide runtime memory bound checking on flexible arrays, and {{{-fstrict-flex-arrays=3}}} is enabled by default, which instructs the compiler to treat only C99 flexible arrays as dynamically sized for the purposes of object size calculation.
Recommended LWN article: Scope-based resource management for the kernel
Enable secret memory by default
Secret memory and its {{{memfd_secret(2)}}} system call was incorporated in Linux 5.14
Due to concerns about the way it deals with memory management it was disabled by default, and enabled with a parameter. These concerns are not important anymore and the feature can be enabled by default.
Initial USB4 v2 support
This release adds initial support for the next USB4 version (USB4 v2) and the Intel Barlow Ridge discrete controller. It includes support for the 80G symmetric link, the necessary configuration needed to bring up the router in v2 mode, adaptive TMU, PCIe extended encapsulation, and CL2 low power link state. Other releases will include the rest of the USB4 v2 support, including asymmetric 128/80G link support.
MIDI 2.0 support
This release adds support for the 2.0 version of the popular MIDI format. MIDI 2.0 is a complete overhaul of the 40-years old MIDI 1.0. Unlike MIDI 1.0 byte stream, MIDI 2.0 uses packets in 32bit words for Universal MIDI Packet
(UMP) protocol It supports both MIDI 1.0 commands for compatibility and the extended MIDI 2.0 commands for higher resolutions and more functions