At the recent Linux Plumbers Conference 2019, Google discussed the development of integrating changes developed in for the Android platform. The ultimate goal is to provide a common kernel for Android usage, instead of preparing separate builds for each device based on an Android-specific branch. . This goal has already been partially achieved, and the conference showcased an Android smartphone, the Xiaomi Poco F1, with firmware based on a standard unmodified Linux kernel.
Once the project is ready, suppliers will be encouraged to provide a base kernel based on the main Linux kernel. Components for hardware support will be supplied by vendors only as additional kernel modules, without applying patches to the kernel. The modules must ensure compatibility with the main kernel regarding kernel symbol namespaces. All changes affecting the main kernel will be promoted upstream. To maintain compatibility with proprietary modules in LTS branches, it is proposed to stabilize the kernel's API and ABI, which will allow module compatibility with updates for each common kernel branch.

In a year, features such as the PSI (Pressure Stall Information) subsystem for analyzing wait times for various resources (CPU, memory, I/O), the BinderFS pseudo-filesystem for the Binder inter-process communication mechanism, and the Energy Aware Scheduling (EAS) task scheduler have been integrated from the Android kernel edition into the main Linux kernel. In the future, Android is planned to transition from the specific SchedTune scheduler to a new subsystem developed by ARM called UtilClamp, based on cgroups2 and the kernel's native mechanisms.

Let’s remember that until now, the kernel for the Android platform went through several preparation stages:
- A branch called 'Android Common Kernel' was created based on the main LTS kernels (3.18, 4.4, 4.9, and 4.14), into which Android-specific patches were integrated (previously, the size of changes reached several million lines, but lately the changes have been reduced to several thousand lines of code).
- Based on the 'Android Common Kernel', chip manufacturers such as Qualcomm developed the 'SoC Kernel', which includes enhancements for hardware support.
- From the 'SoC Kernel', device manufacturers created the 'Device Kernel', incorporating changes related to supporting additional hardware, screens, cameras, audio systems, etc.

Essentially, a unique kernel was developed for each device that could not be used on other devices. This approach significantly complicates the process of delivering updates that address vulnerabilities and transitioning to new kernel branches. For instance, the recently released Pixel 4 smartphone launched in October comes with the Linux 4.14 kernel, which was released two years ago. Partially, Google has attempted to simplify maintenance by promoting a system , allowing manufacturers to create universal hardware support components not tied to specific versions of Android and the Linux kernel releases used. Treble enables the use of already available updates from Google as a basis, integrating device-specific components into them.

Source: opennet.ru
