return to first page linux journal archive
keywordscontents

Kernel Korner

The Bullet Points: Linux 2.4

A look at what's new in the next kernel release.

by Joseph Pranevich

Every so often, something happens that is so breathtaking, so absolutely amazing, that it changes the world. The Linux 2.4 release probably won't be one of those momentous events, but it certainly is an important event in the evolution of Linux. Linux 2.4 marks the first kernel released under Linus' rapid-release plan, where more kernels are released with fewer new features so that those new features can get to the end users faster. Linux 2.4 also includes a lot of ``loose ends'' left over from Linux 2.2, including a number of features that make it more useful to the average desktop user.

I will attempt to outline some features of the new kernel which I think are most important, most revolutionary, or most newsworthy. Your opinions and mine are probably different, but please don't flame me too hard.

Universal Serial Bus

One of the features most requested in 2.2 but undelivered, Linux 2.4 will finally include support for the Universal Serial Bus (USB), an external device architecture that is becoming more and more common for devices such as sound cards, keyboards, modems and printers. This type of device is popular for both PCs (i386) and Macintoshes. The iMac uses USB almost exclusively.

At present, it isn't known how well USB will be supported for 2.4. It is generally expected that most hubs will work, as will keyboards, mice and sound cards (speakers). Support for many other devices will probably be added into the kernel before the release. As I am writing this a couple of months before you'll actually see it, things will probably have changed by the time you read this.

USB support is considered by many to be one of the larger obstacles to Linux's success as a desktop platform in the twenty-first century. While many USB ports in the world currently go unused, the amount of hardware available for this architecture is increasing daily. Sooner or later, it is likely that the ``average'' desktop will require USB support in an operating system.

ISA Plug and Play

Another feature long lacking in the Linux world is ISA PnP, the bus specification adopted by the Windows world to bring intelligence to an unintelligent bus architecture (ISA). Plug and Play has almost always been available under Linux through user-space configuration utilities and by using external modules for drivers. With PnP added into the kernel, it will be possible for the kernel to autodetect these devices explicitly and auto-configure their resources. No more fussing and mussing with unnecessary config files or module configurations. No more updating modules.conf by hand when you install a new card. Of course, your device order might still change.

How did the Linux developers do it? Linux 2.4 also includes a completely rewritten resource-allocation system that allows device resources to be managed more easily than before. It also allows Linux to manage resources for devices where the drivers have not yet been loaded, to prevent accidental misconfigurations of devices--just one of many ``minor'' changes that made major changes so much easier to make.

It's obvious that ISA PnP will benefit Linux most in the desktop arena. It will finally be possible to easily support a much larger percentage of the existing hardware of the world. Linux 2.4-based systems will simply be smarter and simpler in this respect.

PCMCIA Support

Wait! My Linux distribution has supported PCMCIA cards for quite some time! This isn't a new feature...

Actually, for several years, the various distributions have been shipping Linux variants with PCMCIA support provided by an external developer. For various reasons, he chose not to incorporate his code into the mainstream kernel, and left it up to the distributions to work out the issues. This added complexity to an already complex system, and more or less ensured that no distribution could really ship with a ``stock'' Linux kernel. Not to mention the headaches involved in actually getting the matches merged and compiled.

As of Linux 2.4, that will change. While you will still need an external package to handle card manipulation and other issues, support for the PCMCIA devices and buses themselves are now provided in the kernel. This will level the playing field for distributions in some ways, as well as make using PC cards that much easier for those of us who never use a distribution's pre-compiled kernel. I'm writing this on a laptop on which I've never managed to get a working PCMCIA driver for a non-Red Hat kernel; Linux 2.4 will be heaven to me--no more booting into Windows to mail out articles. (Of course, that could just be my stupidity.)

With this feature, Linux scores another point for the desktop user and also for the Linux user on the go. In short, mobile Linux is just more practical. Any feature that makes Linux more practical is a feature I like.

Wake One

These big changes for Linux have all been of great advantage to desktop users, but Linux 2.4 will include many advantages to those who are using more traditional Linux (server) boxes. The change which has garnered the most media attention is wake one.

At heart, wake one is a simple change meant to counteract the ``stampede effect'' seen under certain conditions on busy web servers. Previously, when a number of daemons or other processes were waiting for something to happen over the network, they would all sit idle and then all spring into action at the first sign of communication. Unfortunately, for every web connection, only one daemon can be talking and so most of these lose out and go back to waiting and hoping that they're next. Linux 2.4 has integrated changes which basically wake one of the processes instead of all of them. This results in less unnecessary thrashing of daemon processes and a faster system overall.

Simple? Maybe. In order to support this, Linux 2.4 required a complete rewrite of wait queues and other bits. In addition to solving this problem, Linux 2.4 queues will be more robust and scale better to multiple processors. Just to get an idea of how important Linus felt this change was to Linux, it should be noted that this was the first new feature in Linux 2.3 (the development version, which is to become Linux 2.4).

khttpd: the Kernel Web Server

Also on the server front, Linux 2.4 includes support for a rather revolutionary idea: a web server actually integrated into the kernel. The advantages of this include a faster response time from the server, because it can work directly at the caching layer and doesn't need to make any network calls to user space. However, this change is not meant as a general solution to web hosting; it can serve only files, not CGIs, and it has been designed to be as simple as humanly possible. Any requests it can't handle can be passed to user-space, where Apache or another waiting web daemon can snatch it up and serve it. This double-decker style of web hosting has already been observed to increase server performance in synthetic load environments.

Many Linux users have actually spoken out against this feature, citing the kernel as no place for a web server. My personal feeling is that serving files in this manner is no different than any other in-kernel file server, and it actually does make sense in cases where performance is the true ``key'' issue and simplicity can be assured. Currently, only knfsd actually does file serving from the kernel, but the precedent is there. I don't believe we should, for instance, serve FTP from the kernel or integrate a DNS server into the kernel, but if there is a good advantage to doing something this way, then it should be an option.

Raw Devices

Another feature for servers that Linux 2.4 will support is so-called ``raw'' devices. Raw devices are special device nodes which can be associated with normal block devices to provide direct and low-level access to devices. This can be used, for example, by databases that think they can handle their own caching better than the kernel. The jury is still out on how useful this feature will actually be, rather than how useful its proponents say it is, but this is nonetheless another big step toward providing ``commercial grade'' UNIX features under Linux.

This feature has long been requested by database developers and others who are used to the raw features of other UNIX systems for their server applications. I don't see much need for bypassing caching, except in the case where data integrity is paramount and loss of performance is not an issue. But maybe the feature just isn't for me, and makes perfect sense to a particular type of application.

NFSv3

Just as Windows and Macintoshes have their own protocols and methodologies for accessing shared drives, UNIX systems have NFS, the network file system. Linux has long supported NFS sharing and mounting in all of its flavors. Linux can even boot (without initrd) off such a shared drive. Linux 2.4 adds the oft-requested support for the latest version of the NFS protocol, NFSv3, which includes many improvements over the old system as well as ensuring Linux will be compatible with the commercial UNIX systems of the next millennium.

I believe both servers and desktop users will benefit from this change. Having a more robust NFS layer that supports the latest protocols and enhancements is always a win, and many desktop users who share files may be able to take advantage of the new features in the new NFS.

Parallel Ports

Although many users may not notice it, Linux 2.4 includes a complete rewrite of the parallel-port system (again). Like 2.2, Linux 2.4 includes modular support for parallel-port devices including printers and disk drives. Additionally, Linux 2.4 includes ``generic'' support which would allow for easier support of parallel-port scanners and other devices. Linux 2.4 will also support more parallel ports, including those which require DMA. Many existing systems have this disabled by default in the BIOS; however, it can be reenabled. Also, Linux 2.4 supports using parallel ports as the console. This feature allows some Linux users to use the printer as a debugging tool or keep a hard record of console output.

That's my ``Top 8'' bullet points of Linux 2.4. Opinions vary greatly as to what features or additions are the most important to each new version of the Linux kernel, and you may have a favorite feature not mentioned here. Linux 2.4 is another great milestone along the path to acceptance and usefulness in a wide variety of markets, and I am positive we will be sharing the ``most important features'' debate again soon for Linux 2.6. Until then--happy hacking.

Joseph Pranevich (jpranevich@lycos.com) is an avid Linux geek, and while not working for Lycos, enjoys all kinds of writing and working with a number of open-source projects.