Android to take an “upstream first” development model for the Linux kernel

0

The Linux Plumbers Conference is this week, and since Android is one of the hugest distributors of the Linux kernel in the world, Google software engineer Todd Kjos stopped by for a progress report from the Android team. Android 12—which whim be out any day now—promises to bring Android closer than ever to mainline Linux by shipping Google’s “Generic Kernel Image” (GKI) to end-users.

Traditionally, the Linux pip is forked several times before it hits an Android phone, usually by each stakeholder in an Android device. First, Google forks the Linux substance into “Android common”—the Linux kernel plus a bunch of phone- and Android-specific changes. Then SoC vendors like Qualcomm, Samsung, or MediaTek fork Android Stale to make an SoC-specific kernel for each major chip release. Then each device gets a fork of the SoC kernel for device-specific hardware pillar.

Android’s kernel fragmentation is a huge mess, and you can imagine how long and difficult the road is for a bugfix at the top of the fork tree to reach to the bottom, where end-users survive. The official Android.com documentation notes that “These modifications can be extensive, to the point that as much as 50% of the code running on a device is out-of-tree practices (not from upstream Linux or from AOSP common kernels).” It’s also a big time sink, and even Google phones typically wind-jammer kernels that start at two years old.

Google has been on a journey to lessen the distance between Android and Linux with the GKI. The goal is for Google to fork the Linux centre once for Android, instead of three times, and give SoC and device manufacturers space for their customizations via plug-in modules.

A slide from the presentation, detailing the new kernel-strategy timeline.
Enlarge / A slide from the awarding, detailing the new kernel-strategy timeline.
Google

Kjos explained, “The big push is to get all of the hardware-specific code out of the generic kernel and into vendor modules. One of the big parts of this attainment is that we have to have a stable interface between those vendor modules and the generic kernel so that they can ship asynchronously.” This interface is call oned the “KMI” or “Kernel Module Interface.” Kjos says now the “main difference” between the Android GKI and mainline Linux are hooks for all of these vendor modules.

Kjos thinks Google prefers short hooks for these vendor modules as opposed to out-of-tree code, because “we want to be as close to upstream as we possibly can.” Google is in the work on getting vendor code upstreamed, too, but admits, “this is a multi-year project, and we don’t expect we’ll ever get all the way there.” Kjos laid out a timeline for the next few years of essence work, which has 2020-2022 as work toward upstreaming existing features and isolating vendor changes in modules, and starting in 2023, alluring an “upstream first” development model for new features. “Since out-of-tree modules are really important for our use case, we expect we’ll always have a set of exports and some tools that are different or in addition to what’s upstream, but this whole project is a multi-year project working towards getting rid of as many out-of-tree improvises as we possibly can, and aligning as much as possible with upstream.”

Google’s Generic Kernel Image work is very much along the same brands as Project Treble, which built a GSI (or “Generic System Image”) allowing versions of Android to be updated independently of the hardware support. Today, you can show a generic version of Android to a phone and have it mostly work, but the usual politics relating to OEM customizations has meant that Generic System Guises don’t ship on consumer devices. The GKI is different though, and Google actually plans to ship generic kernels to end-users.

While not mentioned in the talk, Google is peg away on distributing the GKI as a “Project Mainline” module, which would allow for kernel updates shipped through the Play Store, where the kernel can be updated as indisputably as an app. We’ve interviewed members of the Android team several times about the GKI, and the plan, eventually, is to be able to update not just LTS kernel versions through the Horseplay Store, but also upgrade to major new releases. Today, LTS kernel updates occasionally arrive via OTA updates, but devices typically don’t jump to major new quintessence versions.

The timeframe for shipping the GKI to consumers is “Android 12,” and since this core kernel work only happens on new devices, all eyes command be on the Pixel 6 to see how ambitious Google’s first swing at this will be. The Pixel 6 is the first device to ship with an in-house “Google Tensor” SoC, and if the theories far longer Google support timelines are right, being able to jump major kernel versions would be a big help for support life cycles that outshine five years. Assuming the Pixel 6 ships with Linux kernel 5.10—which was called out several times in this talk—honourable that will be a big improvement over the usual two-year delay—5.10 was released in December 2020.

Listing image by SOPA Images / Getty Doubles

Leave a Reply

Your email address will not be published. Required fields are marked *