What’s New In Linux Kernel 4.12 – 15 Biggest Feature and Changes

In April 2017, Linus Torvalds released Linux kernel 4.11, also known as Fearless Coyote. It came with AMDGPU power management improvement, scalable SSD swapping, SMC-R support, new perf trace tool, and more. After 2 months and 7 release candidates, the final Linux kernel 4.12 has been shipped.

According to Torvalds, it is the second biggest release (after version 4.9) in terms of commits. For version 4.12, around 15,000 changes to the source code management system have been made. Now the number of lines of code in the Linux kernel is 24.2 million.

Like its predecessor, the new version also features tons of new functionalities. We’ll enlighten the most important ones.

15. “Improved” Graphic Drivers

The graphic driver “VMWGFX”, which is responsible for many GPUs emulated by VMware products, now supports Atomic Modesetting. Users can influence how far the clock frequency of GPU sinks. The drivers for the graphic cores on the Raspberry Pi can now output audio signals through HDMI.

The kernel 4.12 recognizes external Thunderbolt connected graphics chips, and supports the XBox 360 Gamepads Mad Catz Brawlstick, Razer Sabertooth and Intel’s RealSense SR300 Camera.

14. New Analysis Tool To Optimize Boot Time

Linux kernel sources bring AnalyzeBoot v2.0. The script in tools/power/pm-graph/ generates an HTML file with interactive bar graph that displays how long the kernel subsystem needs to initialize. The required data could collect the script in 2 ways – via function tracer (Ftrace) or the output of dmesg, and specify the kernel option when booting initcall_debug. The observation period begins when kernel starts and ends with the init process.

13. Busy Poll and CAN In Containers

When an app calls epoll_wait() and there are no events available to report, busy polling is done on the associated queue to pull the packets. Apps can constantly pollute a socket (busy poll) and get incoming packets as fast as possible under their wing.

The namespace support in the Controller Area Network (CAN) subsystem allows isolation of apps that communicate through the bus. Users can now run CAN apps with the aid of container techniques like Docker and LXC.

A new driver for virtual CAN tunnels can create local virtual connections, allowing apps to communicate with each other via CAN, running in different namespaces. It is also possible to regulate which applications are allowed to write to the CAN bus.

12. Improvements For USB-C

With the help of USB Type-C Connecter Class, the USB subsystem now offers interfaces that userspace programs can better interact with. Applications can now query status and configure USB C functions like data role swapping and power supply via USB power delivery.

11. Xen Code Transformation

In kernel 4.12, Xen code has a front-end driver for the 9pfs Xen Transport. It promises more efficient data exchange between different Xen domains. Furthermore, Xen code includes multi-touch support in the input device driver, and definitions for more powerful sound and graphic drivers, which could be paravirtualized with the hypervisor.

10. More Support For UEFI Secure Boot

Linux now provides a blacklist keyring. It can name keys that should not be trusted, even though they have trustworthy hashes/signatures. This implements inter alia support for the Blacklist of UEFI Secure Boot. It means that the Kexec function should no longer start any OS, which is rejected by the computer firmware.

9. Generic TEE Subsystem

The new Generic TEE (Trusted Execution Environment) Subsystem allows for an exchange with a mini operating system that runs behind the TrustZone on some ARM SoCs, similar to the management engine for Intel chips. The generic TEE code is a wrapper layer that turns user space ioctl() calls into calls to the low-level driver.

8. Data Integrity Protection for RAID 5

With RAID5-PPL (Partial Parity Log for MD RAID 5), the new kernel now provides a technique to ensure the integrity of a RAID 5 network even in case of 100% crashes. The performance drops as much as 30 to 40%, but some users accept this drawback in order to weigh the data in safety.

7. Authenticated Encryption In Device Mapper

The new dm-integrity Device Mapper Target (DMT) has a block device that saves metadata for later integrity checks on each stored sector. The DMT offers atomic updates to ensure that metadata and utility metadata are guaranteed even when a write operation is interrupted by a crash. Authenticated Encryption is achieved with the help of new Cryptographic Data Integrity Protection. This helps the kernel detect and warn if blocks of an encrypted volume have been altered without the proper key.

Moreover, the RAID implementation of Device Mapper (based on MD code) can now be used to enable the cache function of a log device.

6. 3d Acceleration For Nvidia’s Pascal

The Nouveau driver in the Linux kernel 4.12 supports 3d acceleration in Nvidia’s Pascal used in the GeForce 1000 series. Along with suitable OpenGL driver of current Mesa versions, the GPUs can be elicited a 3d performance, which is sufficient for ordinary games and desktop surfaces like KDEs plasma or Gnome. However, it doesn’t support re-clocking and most economical operating conditions of graphics hardware.

Nouveau also supports GeForce GTX-1050 models, and graphic core GP10B that is installed in the SoC processors of the Tegra X2 series.

5. Memory Bandwidth Allocation and Power Architecture

Linux now supports Memory Bandwidth Allocation, which can be used to control the memory bandwidth during communication between the cores of a processor.

The POWER and POWER 9 architecture now supports up to 512 TeraBytes of virtual address space. Also, improvements have been made to power management in Gemini Lake chips.

Read: 35 Helpful Cheat Sheets for Developers

4. Use XDP With Any Network Interface

Linux 4.8 introduced the Express Data Path (XDP), which can now be used with any network interfaces, thanks to Generic XDP. Since Generic XDP is intended as a reference implementation, it doesn’t promise any impressive performance gain.

This article better explains XDP in general. There are also free lecture and presentation available on how to drop specific packages with XDP early in order to significantly mitigate the effects of DDoS attacks.

3. More Gaps Fill Via Live Patching

The new “Per-Task Consistency Model” lets the Kernel Live Patching (KLP) resolve all gaps in the Linux kernel without restarting the system. It ensures that KLP doesn’t change any code section that is being run somewhere. It also fills gaps where a live patch should modify the memory or data semantics. Furthermore, the changes can unload kernel modules with live patches that are no longer required.

2. AMD’s Vega GPU Support

One of the biggest feature in Linux kernel 4.12 comes in the form of support for AMD ‘s “Vega” graphic processor that recently debuted with the AMD Radeon Vega Frontier Edition. It’s just an initial support, more enhancements would be made in the future.

1. New I/O Schedulers

Two new I/O schedulers have found a place in Linux kernel – Budget Fair Queueing (BFQ) and Facebook’s Kyber.

BFQ promises better data carrier performance and responsive systems, especially with magnetic hard disks. However, in fast SSDs it is counter productive. BFQ grants a higher priority to the read and operations with which the users appear to interact. This is supposed to boost the responsiveness of the programs underneath. However, at the same time, it’s also unfavorable to background processes.

Read: NASA’s 10 Coding Rules for Writing Safety Critical Program

Kyber performs read operations rather than write operations. This would reduce wait time and make systems more responsive because reading operation occurs frequently. On the other hand, writing is asynchronous with many programs, that’s why users do not notice a small delay. Kyber does the write operation after a while, even if many read operations are still pending.

As usual with the new kernel code, both I/O schedulers need a little fine tuning before they execute properly.