Kernel Log: Coming in 2.6.39 (Part 3) - Architecture and infrastructure
by Thorsten Leemhuis
In 2.6.39, the Big Kernel Lock (BKL) disappears for good. The kernel can now process interrupts, which reduces latency. The Xen code now has a network backend needed for Dom0 operation, but it doesn't look like the storage backend will be coming anytime soon.
On Wednesday morning, Linus Torvalds released the sixth release candidate of Linux kernel 2.6.39. It contains several mostly minor changes. Torvalds says kernel developers are still looking into a number of problems, so it will not be the last RC, and it will probably be more than 10 days before 2.6.39 is released.
Prompted by the progress in 2.6.39, the Kernel Log is taking this opportunity to continue the mini-series "Coming in 2.6.39" with a description of the innovations in the kernel's infrastructure and architecture code. The first part dealt with changes to network drivers and infrastructure; the second, with storage and file system code. An article on drivers will follow next week.
In the past few months, the kernel hackers got rid of the Big Kernel Lock (BKL) on all common systems, and now the mechanism is gone for good; in the commit entitled "BKL: That's all, folks", Arnd Bergmann thanks all of the main kernel developers who helped him in the effort. The code that still used BKL was partly modified so that it now makes do without the locking mechanism (e.g. 1, 2, 3, 4, 5, 6). A number of drivers and functions that depended on the BKL are no longer used or were replaced by other code (e.g. 1, 2, 3).
A correction in the scheduler fixes a problem that made Windows guest systems extremely slow to boot when running on KVM if a lot of processors had been assigned to the guest system (changes, git pull request, LWN.net article with background information). KVM now also handles the asynchronous processing of page faults; in other words, the guest system can temporarily execute another thread while the host takes a memory page requested by the current thread out of storage. All of this was originally supposed to be a part of 2.6.38 but had to be postponed because Torvalds and other developers were not satisfied with some of the details. For background information and benchmark results for the technology, see an earlier patch series and a presentation by Gleb Natapov, who was chiefly responsible for the changes.
The Xen code now includes support for Xenbus PM Events, which provides guests with notifications about power management events – such as suspend and hibernate. The basic infrastructure for operation as a Xen host was integrated (Dom0) in 2.6.37 and now kernel 2.6.39 includes a network backend to allow the front-end drivers in Xen guests (DomU) to communicate with other systems. Unfortunately, the storage backend has yet to be provided, so that the .39 kernel still cannot be properly used as Dom0 without additional patches. It seems likely that this situation will not change anytime soon; a few weeks ago, the Xen developers sent the storage backend to LKML for review, and one of the kernel hackers with years of experience harshly criticised the changes and called for a completely different approach.