After two months of development, Linus Torvalds has announced the release of Linux Kernel 6.13. Among the most notable changes are: lazy eviction mode in the task scheduler, support for atomic writes in XFS and Ext4, the 'multigrain timestamps' mechanism, adaptive polling mode in the networking subsystem, the ability to build with AutoFDO optimizations, support for ARM65 Guarded Control Stack security mechanisms, isolation of virtual machines via the ARM CCA extension, separated stacks in BPF, removal of ReiserFS, the virtual-cpufreq driver, netlink API net-shaper, case-sensitive mounting mode for tmpfs, and support for POSIX extensions in SMB3, along with the AMD Cache Optimizer driver.
The new version includes 14,172 corrections from 2,086 developers, with a patch size of 46 MB (the changes affected 15,375 files, adding 598,707 lines of code and removing 406,294 lines). In the previous release, there were 14,607 corrections from 2,167 developers, with a patch size of 37 MB. About 52% of all changes in 6.13 are related to device drivers, approximately 13% pertain to updates to architecture-specific code, 11% are associated with the network stack, 4% relate to file systems, and 3% to the kernel's internal subsystems.
Key innovations in kernel 6.13:
- Disk subsystem, input/output, and file systems
- A 'multigrain timestamps' mechanism has been introduced, allowing for retrieval of file modification or access time information with more than millisecond precision, without negatively impacting performance. The increased precision of timestamps incurs additional overhead due to heightened metadata write intensity to disk, so in the proposed implementation, more precise timestamps are created only for files for which processes request such timestamps via the getattr() call.
- Support for atomic write operations has been added, where data writes larger than the sector size are performed atomically on storage devices that provide such capability. Currently, atomic writes are implemented for XFS, Ext4 with O_DIRECT (Direct I/O) mode, and md RAID 0/1/10.
- A new reference counting mechanism for files has been proposed, providing a performance boost of 3-5% in workloads with more than 255 threads.
- The implementation of the ReiserFS file system has been removed, which was declared obsolete last year.
- A sysctl parameter "fs.dentry-negative" has been added to manage the clearing of "dentry" records (the internal representation of directory elements) in VFS after the associated files are deleted. For some types of workloads, it is optimal to retain such records of deleted files, while for others, it is best to delete them. Therefore, the kernel provides an option for selection (by default, "dentries" are not automatically deleted).
- A flag STATMOUNT_OPT_ARRAY has been added to the statmount() system call for returning a list of filesystem options as an array of null-terminated strings without using the escape sequence "\000". Support has been added for returning the FS subtype (fs_subtype, to determine FUSE usage), safe mounting options, and the original superblock (sb_source).
- OverlayFS now allows specifying layers through file descriptors instead of file path names.
- The tmpfs filesystem has been enhanced with the mounting option "casefold" to operate without case sensitivity and the option "strict_encoding" to prevent the creation of files with names containing invalid UTF-8 characters.
- A new set of system calls has been proposed for managing extended file attributes: setxattrat(), getxattrat(), listxattrat(), and removexattrat(). Unlike the original system calls setxattr(), getxattr(), listxattr(), and removexattr(), the new variants require specifying a directory file descriptor for searching the file path.
- In Btrfs, the ioctl operation BTRFS_IOC_SUBVOL_SYNC_WAIT has been added, which includes waiting for the completion of subvolume cleanup, allowing the command "btrfs subvolume sync" to be executed by non-privileged users who do not have access to ioctl SEARCH_TREE (useful in backup applications that clean up subvolumes). An ioctl operation ENCODED_READ has been added for reading encoded data via io_uring, for example, for reading compressed extents directly without unpacking. Work continues on transitioning to the use of page folios. Competing lock contention during the search for embedded backlinks and when traversing extent buffers has been reduced. The efficiency of extent map compression has been improved.
- In the EROFS (Extendable Read-Only File System) file system, designed for use on partitions accessible in read-only mode, the ability to use SEEK_HOLE and SEEK_DATA options in the lseek() system call has been implemented.
- F2FS has added support for device aliasing, allowing a portion of the block device to be temporarily reserved in F2FS for use by another file system. After completing the external operation, the reserved area can be returned to F2FS. For example, a file system can be created with the command ‘mkfs.f2fs -c /dev/vdc@vdc.file /dev/vdb’, after which the contents of the device /dev/vdc will be reserved and reflected in the file vdc.file, allowing the partition /dev/vdc to be utilized for other purposes, such as formatting it for a different file system. To return the reserved content, simply delete the file vdc.file.
- XFS now supports quotas for realtime devices. Support has been added for a metadata directory, which houses all inodes with metadata.
- The FUSE mechanism now allows dynamic adjustment of the maximum number of pages (FUSE_MAX_MAX_PAGES) using ‘sysctl fs.fuse.max_pages_limit’. Memory page folios are utilized in the operation.
- SMB has implemented support for POSIX extensions for SMB3, necessary for storing special types of files such as fifo, device files, and symbolic links. The ability to mount a partition with an alternative password used during password rotation has been added. A new mounting option ‘cifs.upcall’ for namespace determination has been introduced. Recognition of character and block device files created in Windows NFS Server is ensured. Support for WSL (Windows Subsystem for Linux) style symbolic links has been added.
- The file systems UBIFS, ADFS, BEFS, HFS, HFSPLUS, HPFS, JFS, and ECRYPTFS have been transitioned to use the new partition mounting API.
- The file systems ECRYPTFS, UFS, and NILFS2 have been transitioned to utilize memory page folios.
- Memory and system services
- The scheduler implements a lazy preemption model (PREEMPT_LAZY) that corresponds to the full preemption model for realtime tasks (RR/FIFO/DEADLINE), but delays the preemption of normal tasks (SCHED_NORMAL) until the tick boundary. This delay reduces the instances of preempting lock holders, allowing the performance to approach configurations that use the voluntary preemption model. Thus, the new model preserves the capabilities of full preemption for realtime tasks while minimizing performance dips for regular tasks. Additionally, the new model simplifies the logic of task preemption operations in the kernel by excluding handlers located in other kernel components (outside the task scheduler) from the scheduling process.
- When compiling with Clang, the ability to use optimizations is provided.
Source: opennet.ru
