|
|
Log in / Subscribe / Register

Kernel development

Brief items

Kernel release status

The 2.6.37 kernel is out, released by Linus Torvalds on January 4. New features in 2.6.37 include ext4 scalability improvements, jump labels, "tiny preempt RCU", more BKL removal work, getting rid of barriers in the block subsystem, much of the Xen Dom0 support, fanotify has been re-enabled, and more. As always, see the KernelNewbies 2.6.37 page for lots more information. "As to the big picture, on the whole I think 2.6.37 has been fairly calm. That will likely change with the merge window, as I'm looking forward to getting the new RCU-based pathname lookup and similar exciting features. So enjoy the calm sanity while it lasts". While the merge window is theoretically open, Torvalds said that he will wait a bit before starting the process to "let 2.6.37 cool for a few days to try to encourage people to look at the release rather than go all crazy with newly merged features in the next tree".

While we were on our holiday break, 2.6.37-rc8 was released on December 28. "The -rc8 release shouldn't be all that exciting. The most noticeable is probably the fact that hopefully the 'blank screen' problem with intel graphics is fixed. But on the whole, it's all just a collection of random fixes all over." See the full changelog for all the details.

There have been no stable releases made in the last two weeks. The 2.6.34.8 and 2.6.32.28 longterm kernels along with the 2.6.36.3 stable kernel are in the review process at the time of this writing.

Comments (1 posted)

Quotes of the fortnight

Basically, file systems are not databases, and databases are not file systems. There seems to be an unfortunate tendency for application programmers to want to use file systems as databases, and they suffer as a result.
-- Ted Ts'o

We simply do not add kernel facilities that can produce a stack overflow, memory corruption and triple fault if a rare debug statement triggers in an IRQ context by accident.
-- Ingo Molnar

There is absolutely _no_ excuse for an endless loop in kernel mode. Certainly not "the other end is incompetent".

EVERYBODY is incompetent sometimes. That just means that you must never trust the other end too much. You can't say "we require the server to be sane in order not to lock up".

-- Linus Torvalds

Comments (53 posted)

Paul McKenney's parallel programming book

Paul McKenney has announced the availability of his book on parallel programming. "My thought had been to complete it, then announce it. But I finally realized that it really never will be complete, at least not as long as people keep coming up with new parallel-programming ideas, which I most definitely hope will continue for a very long time." As a mere 358-page PDF, the book clearly has room for growth, but there's a lot of useful information there. A git repository is available for those who want to follow the progress of the book or help with its development.

Comments (29 posted)

Gettys: Bufferbloat in 802.11 and 3G Networks

Jim Gettys has another post on bufferbloat, this time looking at "big fat networks". "A simple concrete optimal example of such a busy network might be 25 802.11 nodes, each with a single packet buffer; no transmit ring, no device hardware buffer, trying to transmit to an access point. Some nodes are far away, and the AP adapts down to, say 2Mbps. This is common. You therefore have 25 * 1500 bytes of buffering; this is > .15 seconds excluding any overhead, if everything goes well; the buffers on the different machines have "aggregated" behavior. This is the optimal case for such a busy network. Even a 802.11g network with everyone running full speed will only be about 10 times better than this."

Comments (16 posted)

Announcing the beta release of PowerTOP 2.0

Arjan van de Ven has announced the beta release of PowerTOP 2.0. "The PowerTOP 2.0 release is effectively a complete rewrite of the PowerTOP code base. The old 1.x code base had grown rather out of hand, having gotten many new features after the very first PowerTOP release without the foresight of a design that accommodated all these features. This new 2.0 codebase extensively uses the kernel "perf" infrastructure to give much more accurate data for the various reports; make sure to enable this in your kernel configuration!"

Full Story (comments: 5)

Kernel development news

A Linux kernel compatibility layer for FreeBSD?

By Jake Edge
January 5, 2011

As part of his work in porting a Linux-based InfiniBand stack to FreeBSD, Jeff Roberson put together a compatibility layer that maps Linux-specific kernel functionality to FreeBSD equivalents. He announced this effort on the freebsd-arch mailing list in order to get a general sense of what other FreeBSD developers thought of the idea—and whether it might make sense to combine it with other, similar, compatibility shims. The thread gives an interesting look into the problems that less popular operating systems have when trying to support new functionality that is already well-established in Linux, even if all of that code is not in the mainline.

The InfiniBand stack that Roberson ported was developed by the OpenFabrics Alliance as part of its OpenFabrics Enterprise Distribution (OFED). It largely consists of patches on top of the existing Linux InfiniBand code. All of the code is available under both the GPL and BSD licenses, which is what allowed Roberson to port it to FreeBSD. In order to minimize changes to that stack, though, he created a fairly large compatibility layer:

The infiniband port has been done by creating a 10,000 line KPI [Kernel Programming Interface] compatability layer. With this layer the vast majority of the driver code runs unmodified. The exceptions are anything that interfaces with skbs and most of the code that deals with network interfaces.

Roberson goes on to list the kinds of things that the compatibility layer supports, including atomic operations, various device types, interrupts, kobjects, radix and rbtrees, lists, spinlocks, and so on. For the most part, it is just translating Linux-isms into their FreeBSD counterparts. The current state of the wrapper can be seen in Roberson's svn repository, which consists of a linux kernel include tree along with code to implement those Linux-isms. The OFED code can then be built by pointing it at the include tree.

Only those parts of Linux that were needed by the OFED code were actually implemented in the compatibility layer, but Roberson wonders if it makes sense to combine his effort with others:

I have seen that some attempt at similar wrappers has been made elsewhere. I wonder if instead of making each one tailored to individual components, which mostly seem to be filesystems so far, should we put this in a central place under compat somewhere?

While there was some predictable Linux-bashing in the thread, most participants seemed favorably inclined toward the compatibility layer itself, as well as making it more widely available to other parts of the FreeBSD kernel tree. There are some difficulties, of course, including exactly which Linux kernel version should be tracked. As was pointed out, somewhat caustically, by Garrett Wollman in the thread, internal Linux interfaces change with some frequency, and without much warning:

Fundamentally, maintaining any sort of Linux compatibility is a losing battle, since the hordes will keep on rototilling interfaces in every release until the cows come home, with no concern (and in many cases utter contempt) for anyone else who might need to maintain kernel code. It's a testament to their size and ability that they have managed to keep the system relatively usable and stable over the long term when major parts of the system get replaced on such a regular basis.

It's not just the size and ability of the Linux community that has led to a stable and usable system, though. As Matthew Jacob notes, Linux developers point to the ability to change the internal interfaces as one of the strengths of their development model. Although the FreeBSD developers may not agree with it, the stable_api_nonsense document does provide reasons for the Linux developers' disdain for stable internal APIs.

Still, choosing a kernel version to track is not necessarily easy. Based on some previous work maintaining an out-of-tree Linux filesystem, Chris BeHanna was able to offer some advice on that:

I would say that you want to pick a major release of one or at most two major commercial distros (I'll pick on Red Hat Enterprise Linux and the enterprise SuSE for illustration), and track the major releases of them that correspond to roughly the same Linux kernel version, and then STICK to that for the life of a given FreeBSD release stream. Commercial vendors backport fixes into their otherwise-fairly-stable major releases, which minimizes your pain. There are still some changes here and there along the way, and you have to decide how many kernel config options you are willing to support (I'd suggest the default SMP, maybe the default PAE, and punt everything else or you'll go mad).

The combinatorial pain of committing to more than that leads to a desire for seppuku: I had to support multiple kernel versions each (and often multiple configurations per kernel) for Red Hat 7, 8, 9; RHEL 4 and 5, SuSE Enterprise 9, 10, 10.1, and 10.2, SuSE Desktop 9 and 10, and Fedora 4, 5, and 6 across x86, x86-64, and IA-64, and it ended up being more than 400 binaries to be generated, tested, and delivered every time we issued a patch release.

There are some obvious advantages to using the OFED code with minimal modifications. Bug fixes and enhancements are being made regularly that could be incorporated into the FreeBSD kernel fairly easily using the compatibility layer. But some argue that adding such a layer will result in fewer vendors trying to get their code working natively for FreeBSD, likening it to the linuxulator that allows Linux binaries to run on FreeBSD. Alexander Kabaev put it this way:

[...] [A] Linux compat layer in kernel will have the same effect as linuxulator in userland - we do have some vendors still trying to bother with FreeBSD drivers for their hardware now and we will have none after we provide the possibility to hack their Linux code to run somewhat stably on top of Linux compat layer.

But Roberson is not convinced that the linuxulator has had a negative effect on FreeBSD market share, and instead sees it as allowing FreeBSD to "stay relevant in areas where companies can not justify an independent FreeBSD effort. Adobe is a good example of this."

Roberson seems to be taking a pragmatic approach to getting InfiniBand support into current versions of FreeBSD. Evidently there is an InfiniBand stack that runs on earlier versions of FreeBSD, but it hasn't been maintained for more recent kernels. There aren't any real alternatives, as he sees it:

Our options are, to leave FreeBSD users without infiniband, which I can tell you has cost us more market share as I know of specific cases we have lost due to it. To maintain our own stack independently, which no one has the budget for. Or to try to integrate with OFED. Do you see some other approach?

So far, there has been no answer to his question. It may be that the compatibility layer continues to live in the InfiniBand tree, rather than move to a more widely accessible place, but there seems to be no one stepping up to develop and maintain a FreeBSD-specific stack. While there is some resistance to the 10,000-line size of the layer, it is, for the most part, a pretty thin shim, as Roberson describes:

Let's talk nuts and bolts about what this thing does. In the vast majority of cases it simply shuffles arguments and function names around where there is a 1:1 correlation between linux api and FreeBSD API. Think about things like atomics, callouts, locks, jiffies vs ticks, etc. In these areas the systems are trivially different. In a very small number of areas where this wasn't the case I did a direct port and noted it with an #ifdef.

It wasn't brought up in the thread, but there may also be questions about the license of the compatibility layer (seemingly BSD-only) at some point. Lawyers might argue that it is a derivative work of the Linux kernel. It's unlikely to be a real problem unless someone takes the code into a closed-source product, which is something that the BSD license allows. Specifically licensing it under the GPL would avoid that particular problem, though that might not fit well with the goals of the FreeBSD project.

It is undoubtedly galling to some in the FreeBSD community to adopt a big chunk of Linux code along with a Linux mapping layer, but the reality is that the community isn't large enough to go it alone, at least for InfiniBand. In some ways it is reminiscent of the problems that came about when the new direct rendering manager (DRM) development process was announced. In both cases, the community of FreeBSD users and developers is just not large enough to justify some kind of dual-OS approach.

On the other hand, though, in both cases the licenses specifically allow Linux and FreeBSD (and others) to incorporate the code. While there are lots of technical and development process barriers to more collaboration between Linux and the BSD world, the usually painful license incompatibility issue did not rear its head. With luck, that will play out well for both sides, with dual-licensed patches going in both directions, hopefully without the rancor that sometimes occurs.

[Thanks to James Andrewartha for giving us a heads-up about this topic.]

Comments (6 posted)

The trouble with firmware

By Jake Edge
January 5, 2011

Within the various communities that make up the free software world, there are many different opinions on exactly what constitutes "freedom". Those opinions run the gamut from extremely pragmatic to exceedingly strict definitions of "free". Firmware blobs for drivers—almost always released without source code and often without any clear license—have been particularly troublesome for certain projects. Debian has struggled with the problem over the years, finally resolving it by moving the non-free firmware out of its main repository for the upcoming 6.0 ("Squeeze") release. But there are others who find even that insufficient and would like to see any mention of the non-free firmware files removed from the kernel.

The Linux-libre project aims to deliver a completely free (under its definition) Linux distribution. It does that by removing any programs that either don't come with source code, or that has source code that is licensed in a way that does not allow users to modify it. Many Linux distributions already follow those guidelines, but Linux-libre takes things one step further and removes anything that "induces or requires you to install additional pieces of non-Free Software".

As might be guessed, Linux-libre has a rather liberal interpretation of what "induces" means, which is where the kernel firmware loading mechanism runs afoul of the distribution's goals. Linux-libre has already eliminated the non-free firmware from its repositories, but there is still a problem: the kernel will make a request to user space for (potentially) non-free firmware when it loads a driver that requires it. So in the minds of the Linux-libre developers, the kernel is now inducing users to install non-free software.

If user space cannot find the firmware file, then the driver obviously cannot load it into the hardware. That makes the hardware non-functional, presumably, but far worse from an inducement perspective, the kernel puts a message into the log specifically noting the filename that couldn't be found. Evidently, that will induce users to go find a file by that name and install it, thus resulting in a non-free system.

In a discussion about Debian's Squeeze kernel on the linux-libre mailing list, Richard Stallman mentioned a plan to obfuscate the names of the firmware files within the Linux-libre kernel. Part of his message was picked up as a Kernel page "quote of the week", partly because it seems like something of a contradiction to promote freedom by hiding the proper names of firmware files. It's also a little puzzling because the GPL and the software freedom movement is so clearly focused on the rights of users.

But Stallman isn't trying to stop users from finding the firmware, he just wants to ensure that the distribution doesn't induce them to install it. That distinction may seem rather arbitrary to many, but not to him. In response to a concern expressed by Alexandre Oliva about web pages that would show the mapping between the Linux-libre obfuscated names and those of the actual filenames, Stallman explained:

Remember, the goal is not to prevent people from finding these files. [...] Our goal is to avoid steering users towards nonfree software. If they find these identifiers and look them up, I think it will be clear to them that we are not.

The plan seems to go far beyond just creating a kernel with obfuscated firmware names, though. It would be fairly straightforward to run a script on the kernel source that applied some kind of obfuscation filter to the firmware filenames before building the kernel, but that doesn't completely alleviate the problem for Linux-libre. It would also like to have a kernel Git repository with the mangled filenames, but there are problems with that approach as Oliva notes:

I'd love to have this in a git repository rather than as deblobbing scripts, but a solution for the problem of creating a git repository that can track Linux upstream without carrying the non-Free bits that the Linux git repository carries has so far eluded me.

From there, the conversation starts to take on some Orwellian tones. It is not enough to just have the new firmware filenames in the HEAD of the Git repository, Oliva and Stallman would like to eliminate references to the original filenames (and the firmware files themselves) from the repository history. But they also would like to be able to pull from Linus Torvalds's mainline tree periodically. It is a tricky set of conditions to try to fulfill.

As part of the discussion on how to handle it, Stallman seems to bristle over the term "rewriting history"—perhaps because of its Orwellian overtones. He sees that term as (somehow) pushing Torvalds's views:

In effect, it claims that "If Torvalds let someone put nonfree software into a present or even past version of Linux, everyone who wants to refer to a repository of Linux is obligated to refer to that nonfree code." That is his views. We believe it is wrong to tell anyone about this nonfree software, and we will not follow his views.

Stallman doesn't necessarily see being able to pull from the mainline as much more than a convenience. But Oliva, who clearly has more Git and kernel workflow experience than Stallman, is fairly adamant:

However, it is an absolute must for any of us to be able to trivially pull changes from upstream. Actually, make that upstreams, for any branch that tracks Linus' tree and has additional patches might be desirable for any of us to merge into our personal or published repositories. If the Linux-libre repository doesn't fit into people's regular workflow, there will be a strong incentive against using it, against developing improvements for Linux on it. It would be self-defeating. I don't want this kind of pain, not for myself, not for other contributors.

To that end, Oliva asked for ways to accomplish this goal on the Git mailing list. He comes up with some plausible scenarios where others might want this kind of functionality, beyond just the needs of Linux-libre:

Say, portions that are illegal, immoral or too risky in my jurisdiction: patented stuff that lawyers say I should not distribute in any way, unauthorized or otherwise copyright-infringing bits, text or pictures that are offensive or even illegal to publish, i.e., stuff that I must not be caught distributing and that, ideally, I could arrange to not even possess.

A few suggestions of possible workflows were made in that thread, but Oliva seems to be leaning toward using git-filter-branch and either some scripts or changes to Git to facilitate this effort. While his scenarios are a little bit of a stretch—why distribute a project that contains these problematic pieces?—they aren't completely beyond the pale. Others could benefit from whatever solution Linux-libre finally settles on.

It's certainly not the first time that Stallman has seemed to be tilting at windmills, and plenty of folks will find this effort to be pointless, even comical. There are some good arguments on both sides of the firmware debate, but it is a bit hard to see how making it more difficult to get hardware working on Linux-libre is going to lead to more adoption of that distribution. Far more likely, it would seem, is that folks just grab a different distribution (or operating system entirely) and move on.

Comments (24 posted)

Who wrote 2.6.37

By Jonathan Corbet
December 30, 2010
The 2.6.37 development cycle is coming to a close; that must mean that it is time to look at the development statistics for this release. 2.6.37 has been a more active cycle than most, with 11,220 non-merge changesets added (as of 2.6.37-rc7). Only three cycles have seen more changes: 2.6.25 (12,243 changesets), 2.6.29 (11,678), and 2.6.30 (11,989). The relatively slow period since 2.6.33 appears to have come to an end.

The 2.6.36 kernel was unique in that it was actually smaller than its predecessor. 2.6.37 does not continue that trend; some 1,140,000 lines of code were added, and 641,000 lines were removed, for a net growth of 494,000 lines. Most notably, perhaps: the 2.6.37 kernel includes patches from 1,250 developers, the highest ever. The development community, clearly, is active and growing.

The most active contributors this time around were:

Most active 2.6.37 developers
By changesets
Chris Wilson2111.9%
Greg Kroah-Hartman1711.5%
Eric Dumazet1661.5%
Johannes Berg1491.3%
Thomas Gleixner1471.3%
Paul Mundt1401.2%
Mauro Carvalho Chehab1221.1%
Joe Perches1071.0%
Avi Kivity1050.9%
Mark Brown1000.9%
Hans Verkuil1000.9%
Namhyung Kim1000.9%
Dan Carpenter990.9%
Christoph Hellwig930.8%
Jean Delvare880.8%
Axel Lin880.8%
Daniel Vetter870.8%
Vasiliy Kulikov860.8%
Arnd Bergmann860.8%
Julia Lawall840.7%
By changed lines
Henry Ptasinski1433039.6%
Greg Kroah-Hartman1008616.7%
Vipin Mehta923986.2%
Luis R. Rodriguez716364.8%
Mark Brown536903.6%
David Cross481983.2%
Dmitry Kravkov471983.1%
Larry Finger403782.7%
Krishna Gudipati387122.6%
Stefan Richter294342.0%
Stephen Hemminger285041.9%
Rasesh Mody223351.5%
Prashant P. Shah150861.0%
Michael Chan141180.9%
Christian Lamparter135300.9%
Liam Girdwood133240.9%
William Hubbs129710.9%
Vinod Koul129440.9%
Marek Belisko115310.8%
Al Cho100970.7%

These lists feature a combination of old and new names. Chris Wilson got to the top of the by-changesets list by virtue of his work with the Intel graphics drivers. Greg Kroah-Hartman worked on the USB and TTY subsystems, but the bulk of his changes were made to the staging tree, and the new brcm80211 driver in particular. Eric Dumazet has been active all over the networking layer, Johannes Berg has been busy with wireless networking, and Thomas Gleixner rewrote the generic interrupt handling code (among many other things).

Looking at lines changed: Henry Ptasinski arrived at the top of the list through the addition of the brcm80211 driver which, as can be seen, is not a small piece of code. Vipin Mehta added the ath6kl driver to the staging tree, Luis Rodriguez worked on the mac80211 layer and the ath9k driver, and Mark Brown, as always, did a massive amount of work within the ALSA sound layer. It's interesting to note that five of the top ten in this column were mainly involved with the staging tree. One of the others (Krishna Gudipati) submitted a single "driver cleanup patch" which drew Linus's ire at the time - calling a nearly 40,000-line patch a "cleanup" seemed like a bit much.

A minimum of 193 employers supported work on the 2.6.37 kernel; the top supporters were:

Most active 2.6.37 employers
By changesets
(None)186416.6%
Red Hat126511.3%
(Unknown)9468.4%
Intel7466.6%
Novell6445.7%
IBM4474.0%
Oracle2722.4%
Texas Instruments2502.2%
Nokia2352.1%
Renesas Technology2101.9%
Samsung2051.8%
Broadcom1721.5%
Societe Française de Radiotelephone1661.5%
AMD1631.5%
(Consultant)1551.4%
Pengutronix1541.4%
(Academia)1461.3%
Wolfson Micro1291.1%
Google1281.1%
Fujitsu1271.1%
By lines changed
Broadcom24674916.4%
(None)18883012.6%
Atheros16569311.0%
Novell1274768.5%
Wolfson Micro1001966.7%
Brocade640124.3%
(Unknown)593254.0%
Red Hat590003.9%
Intel538933.6%
Cypress Semiconductor482413.2%
Vyatta307202.0%
Texas Instruments228741.5%
Samsung167711.1%
IBM165671.1%
Nokia147311.0%
Renesas Technology144881.0%
(Consultant)135920.9%
Slimlogic Ltd133240.9%
ST Ericsson130560.9%
Chelsio107700.7%

Looking at the by-changesets column, the situation looks mostly like business as usual. Red Hat remains, by far, the largest corporate contributor to the kernel. On the lines-changed side, instead, Red Hat had to settle for eighth place behind companies which, for the most part, have contributed a lot of driver code.

It has been some time since we looked at the reviewing and testing of code. In the 2.6.37 development cycle, the developers with the most Reviewed-by tags were:

Most active 2.6.37 reviewers
Ingo Molnar8612.6%
Christoph Hellwig375.4%
Mike Christie294.3%
Michael Chan263.8%
Josh Triplett223.2%
Daniel Vetter213.1%
Chuck Lever213.1%
H. Peter Anvin202.9%
Konrad Rzeszutek Wilk192.8%
Alex Elder172.5%
Luciano Coelho162.3%
Suresh Jayaraman162.3%
Swen Schillig162.3%
Michal Marek152.2%
Jeff Layton152.2%
Sam Ravnborg152.2%
Wu Fengguang121.8%
Francisco Jerez121.8%
KOSAKI Motohiro121.8%
Christoph Lameter111.6%

As always, there is only so much that can be learned from these numbers; the bulk of all patch reviews do not lead to the addition of a Reviewed-by tag. On the other hand, there has been some real social pressure to credit users who test patches and report bugs:

Most credited 2.6.37 reporters and testers
Reported-by credits
Stephen Rothwell244.2%
Randy Dunlap213.7%
Linus Torvalds193.3%
Ingo Molnar152.6%
Guennadi Liakhovetski101.8%
Jonathan Cameron71.2%
David Brownell71.2%
Sitsofe Wheeler61.1%
Andrew Morton61.1%
Dan Rosenberg61.1%
Jiri Slaby50.9%
Ben Greear50.9%
Eric Dumazet40.7%
Daniel Vetter40.7%
David S. Miller40.7%
Robin Holt40.7%
Andi Kleen40.7%
Dan Carpenter40.7%
Sachin Sant40.7%
Dr. David Alan Gilbert40.7%
Tested-by: credits
Wolfram Sang154.1%
Luciano Coelho113.0%
Kevin Hilman102.7%
Jeff Pieper102.7%
Will Deacon92.5%
Caglar Akyuz82.2%
Michael Williamson82.2%
Emil Tantilov71.9%
Randy Dunlap61.6%
Stephen Ko61.6%
Ben Greear61.6%
Eric Benard51.4%
Tuomas Katila51.4%
Maxim Levitsky51.4%
Ingo Molnar41.1%
Juuso Oikarinen30.8%
Jason Wessel30.8%
Kuninori Morimoto30.8%
Rabin Vincent30.8%
Ben Gardiner30.8%

All told, there were 568 Reported-by and 366 Tested-by tag lines found in patches merged for 2.6.37. We are, it seems, slowly getting better at recognizing the people who are doing this crucially important work.

In summary, the kernel development process continues to look healthy. We have a great deal of activity from an increasing number of developers, while, it seems, keeping a reasonable lid on the number of regressions introduced. Whether the high patch rate will continue into 2.6.38 remains to be seen; as of this writing, there are just under 5,000 changes in linux-next. Unless the subsystem maintainers put more work into linux-next in the near future, the next development cycle could be relatively slow.

Comments (9 posted)

Patches and updates

Kernel trees

Linus Torvalds Linux 2.6.37-rc8 ?
Linus Torvalds Linux 2.6.37 ?

Architecture-specific

Build system

Core kernel code

Development tools

Device drivers

Filesystems and block I/O

Memory management

Networking

stefani@seibold.net UDPCP Communication Protocol ?
Rodolfo Giometti Network Virtual Terminal ?

Virtualization and containers

Page editor: Jonathan Corbet
Next page: Distributions>>


Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds