The Kernel Column with Jon Masters
Jon Masters summarises the latest goings-on in the Linux kernel community, including the 2012 Kernel Summit and the closing of the 3.6 merge window
Linus Torvalds announced the release of the 3.5 kernel in time for last month’s issue, and with it the opening of the merge window for 3.6. The merge window is the period of time during which Linus takes source code patches (modifications) that are more disruptive in nature than simple bug fixes. It is during this time that major new features are merged, following a complete test cycle (eg the entire life of 3.5) in the linux-next and staging (in the case of new drivers only) trees.
During the 3.6 merge window, Linus pulled in a number of cool new features, including ‘suspend to both’, which is a feature that writes out a hibernation disk image at the same time as suspending to RAM. It is a feature that has existed on other operating systems (such as Apple’s OS X) for some time and it is the reason (for example) that a Mac which has run low on battery during suspend is still able to resume successfully. Resuming from disk is of course slower than resuming from RAM, but it is a nice fallback in the case that a laptop or mobile device’s battery drains completely during the period that it is suspended. Other changes include better random number generator support (read on for more detail) and the continuing reworking of EFI support in anticipation of running on future platforms that use Microsoft’s ‘Secure Boot’ approach in the next Windows release.
Kernel Summit 2012
Every year for more than a decade, a small group of core kernel developers have gathered for the Kernel Summit. The event began life when early developer Ted Ts’o and others got together to organise a face-to-face and it has been an invitation-only event for many years. Except this year. 2012 marked a change in protocol as the Kernel Summit struggles to balance the desire to remain focused with an ever growing desire to be more inclusive, especially of those who are entering the world of kernel development. The event ran for its typical three days (this year in San Diego), but only one of those was by invitation. The latter two days of mini- summits (targeted at specific architectures or subsystems) were open and co-located with the Linux Plumbers Conference. There were the usual debates around code quality and remaining relevant to users, as well as another round of debate on upstreaming the Android patches into the standard kernel.
The ARM mini-summit, run by Arnd Bergmann, was particularly interesting. ARM is by far the most active architecture in the Linux kernel today, supporting thousands of devices built upon many different sub-architecture variants. Keeping the chaos in check these days is the arm-soc tree, which Arnd maintains. In many ways arm-soc is more critical than the official 32-bit ARM kernel tree maintained by Russell King because it is through arm-soc that all of the varied platform code from dozens of different SoC vendors must pass on its way into the kernel. It is also arm-soc that is home to the effort at ARM kernel unification: building a single binary kernel that can boot on many different ARM systems, similar to how x86 does today.
Other ARM mini-summit discussions focused on the Secure Monitor APIs used to communicate between the kernel and protected firmware provided by the system vendor. These APIs are need for early platform initialisation, including SMP boot protocol implementation and cache configuration. Perhaps most interesting of all, however, was the first official Kernel Summit discussion of the new AArch64 64-bit ARM architecture. ARM announced AArch64 last year and Catalin Marinas gave a summary of the current status in anticipation of his LinuxCon talk (at the same venue) a few days later. Will Deacon posted some detailed summaries of the ARM mini-summit. These include coverage of virtualisation and stale platform deprecation not mentioned in detail in this article.
Vasillis Liaskovitis pointed out a problem with the handling of memory hotplugging. The Linux memory subsystem (drivers/base/memory.c) divides physical system memory into memory_ block objects (not to be confused with Logical Memory Blocks, which are a different construct for early boot time memory management before the SLAB memory allocator is used).
These are represented in the sysfs (/sys/ devices/system/memory/…), along with various state information. Recent kernels support the notion of hotpluggable memory – the ability to remove memory modules at runtime. This is done either through an ACPI event (triggered by the user doing something physically to the machine, hitting a button on a memory module to request its removal, for example) or through an explicit write into a sysfs file. It turned out, however, that the ACPI case was not always updating the memory block to a state of MEM_OFFLINE, preventing the removal from succeeding without a patch that was supplied.
Ted Ts’o reworked the code that implements additions to the random number generator entropy pool during certain interrupts. The standard Linux random number support (/dev/random and its non-blocking /dev/urandom counterpart) provides high-quality near random numbers using a software hashing algorithm and environmental noise as input. That environmental noise can come from user keyboard and mouse movements, certain platform data and other non-predictable information. One of the key vectors for adding entropy (randomness) into the random number generator has traditionally been through certain interrupt handlers. Many interrupts are randomly timed and occurred in non-predictable ways, but sometimes there can be theoretical attacks caused by predicting how hardware might behave ahead of time. For this reason, Ted implemented a patch to limit the rate of addition of certain interrupt- time supplied data to once per second. This led to an interesting side discussion about whether certain platforms were using the timer interrupt as an entropy source (which is obviously far too predictable). Ted sent a second patch intended to force the timer interrupt to be ignored.
Additional reworking of the random number generator saw support for Intel’s latest RDRAND instruction on Ivy Bridge processors. The new instruction provides implementation support for on-chip random number generators in the latest Intel chips. These are benchmarked to operate 10-12 times faster than the standard software approaches Linux uses for gathering random entropy. Clearly, Intel was keen to see support added for this new feature, but Ted (who originally authored the random number generator code many years ago) pushed back on the RDRAND patches, saying that he favoured not using the data supplied directly, but mixing it with other entropy sources. His concern was that there was no real way for Intel (or anyone else) to prove that its random number generator had not been influenced by a US government agency to make it deliberately weak in some fashion, even without endorsement.
After some debate, the patches were reworked in the fashion described.
The summer is typically high conference season. Not only was there the Linux Kernel Summit, but also the Linux Plumbers Conference and LinuxCon over the past month. Nonetheless, this did not preclude an unusually high number of utility releases in the same period. Stephen Hemminger noted that he was “Following the trend of releasing before going on vacation” in posting iproute 3.5.0. Similar releases came from Karel Zak, author of util- linux, which gained a number of new utilities that come from dead or dying upstreams, including ‘su’ and ‘eject’. There were also new Git and Autofs tools releases.
Finally this month, a tribute to outgoing kernel.org administrator John Hawley. John has been involved with kernel.org for many years and has done an excellent job in providing services to the kernel community, such as git.kernel.org, the web service, mirrors.kernel.org, and much more besides. He was principally tasked with cleanup following the ugly break-in that took place last summer, and faced many sleepless nights getting things back in order. He moves on to even more fun things and will be missed.