LWN Weekly Edition Front pageSecurity Kernel development Distributions Development Linux in the news Announcements ->One big page
This page Previous weekFollowing week |
Kernel developmentRelease status Kernel release status The current 2.6 prepatch is 2.6.11-rc4, released by Linus on February 12. This prepatch, intended to be the last before 2.6.11 is released, is dominated by small fixes; it also contains some architecture updates, a serial ATA blacklist (for poorly-behaved drives), some extra checking for read() and write() calls (covered in last week's Kernel Page), a largish Radeon framebuffer update, and an IDE update. The long-format changelog has the details.Linus's BitKeeper repository contains a handful of fixes, including a patch for a few memset() calls in the S/390 code which had the arguments reversed - and somehow seemed to work anyway. The current -mm prepatch is 2.6.11-rc3-mm2. Recent changes to -mm include the addition of the realtime Linux security module, an NFS update, and various fixes. The current 2.4 prepatch is 2.4.30-pre1, released by Marcelo on February 10. As would be expected for a kernel in deep maintenance mode, this prepatch contains a relatively small set of fixes and a couple of driver updates.
Kernel development news Quote of the week
However, then when I start looking at n_tty_receive_room() and
n_tty_receive_buf(), my stomach gets a bit queasy. I have this
horrid feeling that I had something to do with the mess, but I'm
going to lash out and blame somebody else, like tytso, for most of
it....
-- Linus Torvalds finds a problem and
"fixes" it
I'd love for somebody to try to take a look at where n_tty goes wrong, but I think that for now I'll just make the fix be the cheezy "limit tty chunks to 2kB". It's worked for a decade, it can work for a bit longer ;)
The 2.4-hf tree launches The 2.4 kernel is now in a deep maintenance mode; all of the exciting activity is happening in 2.6 instead. As a result, several months can pass between 2.4 releases. That delay should not normally be a problem, but it can be an issue for users who get bitten by a bug, or who need an important security fix. There are still quite a few systems running 2.4 kernels, after all, and not everybody wants to wait for months for a fix to a show-stopper bug.It does not appear that the 2.4 process will speed up, however. Instead, Willy Tarreau, working with Marcelo, has created a new 2.4 "hotfix" tree; the first (announced) release is 2.4.29-hf2. This tree is created entirely by cherry-picking patches out of the 2.4 BitKeeper repository; as such, it contains only patches which will be part of the next official 2.4 kernel. The tree contains a few security fixes (none of which appear particularly urgent), one "critical fix" (for a panic in LVM), and various other bug fixes. The latest -hf patches will always be available on Willy's site.
Recent Changes to /sbin/hotplug With the recent announcement of a replacement for the existing Linux Hotplug script project with a version written in C called hotplug-ng, attention has been renewed as to how the whole Linux hotplug process works. This article is an attempt to explain this process, describing the history of how we got here, and pointing out the directions in which things will probably be changing.
The With this humble beginning, the linux-hotplug project started, and over time, a nice collection of shell scripts were created by a number of developers, led primarily by David Brownell. These scripts are installed by almost all Linux distribution, and enable USB, SCSI, Firewire, PCI, and a number of other types of drivers to be loaded automatically when a device is inserted into the system. Thanks to these scripts, Linux accomplished a very good "it just works" feeling for a lot of users of the 2.4 and 2.6 kernels. As time went on, more and more projects wanted to be notified by the kernel that something had happened so that it could try to do things automatically for the user. Things like:
Things got complexThen along cameudev
and the 2.6 kernel, and the frailty of the existing
hotplug scripts were really felt. The 2.6 kernel changed the way hotplug
events were created by the kernel. Instead of only emitting an event for a
limited set of devices, everything that had a kobject registered in sysfs
created a hotplug event. Due to the driver model conversion of all
different busses in the kernel, now hotplug events were being created for
many more things than the linux-hotplug scripts cared about. People
realized that this was going to cause a big mess and a new type of
/sbin/hotplug program was proposed and created.
If you look at the current version of /sbin/hotplug, it is now a very simple bash script:
DIR="/etc/hotplug.d"
for I in "${DIR}/$1/"*.hotplug "${DIR}/"default/*.hotplug ; do
if [ -f $I ]; then
test -x $I && $I $1 ;
fi
done
exit 1
What this script now does is allow any program to be called for hotplug
events from the kernel. Every time a hotplug event is created by the
kernel, the script passes execution on to any program listed in the
So, for example, if you want to be notified of all USB hotplug events, put
a symlink to your program in the
/etc/hotplug.d/
`-- default
|-- 10-udev.hotplug -> ../../../sbin/udevsend
|-- 20-hal.hotplug -> /usr/libexec/hal.hotplug
`-- default.hotplug
This arrangement means that udevsend is called first for any hotplug event,
followed by HAL, and then finally, the default linux-hotplug scripts.
The recent hotplug-ng announcement merely replaces the existing
Another noted goal of the hotplug-ng project was to replace the existing linux-hotplug bash scripts for loading modules for new devices with small executable programs. It shipped 3 examples of this, one for USB, PCI and SCSI devices. Soon after the announcement, a IEEE1394 program was submitted for inclusion in the package.
How a module is foundWhen the kernel finds a new device and registers it with sysfs, a hotplug event is generated that describes the new device in a bus specific manner through a number of different environment variables. For example, a USB device creates the following variables when it is found:
PRODUCT=idVendor/idProduct/bcDevice
TYPE=bDeviceClass/bDeviceSubClass/bDeviceProtocol
INTERFACE=bInterfaceClass/bInterfaceSubClass/bInterfaceProtocol
The hotplug scripts then split those environment variables apart into
individual numbers, and then search the
This scanning of the
$ modinfo tulip filename: /lib/modules/2.6.11-rc4/kernel/drivers/net/tulip/tulip.ko author: The Linux Kernel Team description: Digital 21*4* Tulip ethernet driver license: GPL version: 1.1.13 parmtype: tulip_debug:int parmtype: max_interrupt_work:int parmtype: rx_copybreak:int parmtype: csr0:int parmtype: options:array of int parmtype: full_duplex:array of int vermagic: 2.6.11-rc4 SMP PENTIUM4 gcc-3.4 depends: alias: pci:v00001011d00000009sv*sd*bc*sc*i* alias: pci:v00001011d00000019sv*sd*bc*sc*i* alias: pci:v000011ADd00000002sv*sd*bc*sc*i* alias: pci:v000010D9d00000512sv*sd*bc*sc*i* alias: pci:v000010D9d00000531sv*sd*bc*sc*i* alias: pci:v0000125Bd00001400sv*sd*bc*sc*i* alias: pci:v000011ADd0000C115sv*sd*bc*sc*i* alias: pci:v00001317d00000981sv*sd*bc*sc*i* alias: pci:v00001317d00000985sv*sd*bc*sc*i* alias: pci:v00001317d00001985sv*sd*bc*sc*i* alias: pci:v00001317d00009511sv*sd*bc*sc*i* alias: pci:v000013D1d0000AB02sv*sd*bc*sc*i* alias: pci:v000013D1d0000AB03sv*sd*bc*sc*i* alias: pci:v000013D1d0000AB08sv*sd*bc*sc*i* alias: pci:v0000104Ad00000981sv*sd*bc*sc*i* alias: pci:v0000104Ad00002774sv*sd*bc*sc*i* alias: pci:v00001259d0000A120sv*sd*bc*sc*i* alias: pci:v000011F6d00009881sv*sd*bc*sc*i* alias: pci:v00008086d00000039sv*sd*bc*sc*i* alias: pci:v00001282d00009100sv*sd*bc*sc*i* alias: pci:v00001282d00009102sv*sd*bc*sc*i* alias: pci:v00001113d00001216sv*sd*bc*sc*i* alias: pci:v00001113d00001217sv*sd*bc*sc*i* alias: pci:v00001113d00009511sv*sd*bc*sc*i* alias: pci:v00001186d00001541sv*sd*bc*sc*i* alias: pci:v00001186d00001561sv*sd*bc*sc*i* alias: pci:v00001186d00001591sv*sd*bc*sc*i* alias: pci:v000014F1d00001803sv*sd*bc*sc*i* alias: pci:v00001626d00008410sv*sd*bc*sc*i* alias: pci:v00001737d0000AB09sv*sd*bc*sc*i* alias: pci:v00001737d0000AB08sv*sd*bc*sc*i* alias: pci:v000017B3d0000AB08sv*sd*bc*sc*i* alias: pci:v000010B9d00005261sv*sd*bc*sc*i* alias: pci:v000010B9d00005263sv*sd*bc*sc*i* alias: pci:v000010B7d00009300sv*sd*bc*sc*i* srcversion: 2B43BFCB982491A0D0794ECThose module alias values are created directly from the MODULE_DEVICE_TABLE()
values in the driver, and match the
modules.*map
files information. So, the hotplug-ng programs build up the
module alias based on the environment variables passed to it, and then
invokes the modprobe program directly. This greatly speeds up the whole
module loading process. On this authors slow laptop, it went from 2
seconds to load a USB module for a newly seen device, to less than 1 with
the hotplug-ng programs.
Disruption in the forceThis was all well and good, until Roman Kagan made the very obvious observation that this whole process of creating environment variables, and then splitting them apart was incredibly stupid. Why not have the kernel itself just create the module alias string in the first place and add that to the hotplug call? That way the whole userspace process could be made incredibly simple. Sometimes the developers that are closest to the problem miss obvious issues like this as they forget to step back and view the whole picture properly. This revelation was received very well , and it will be added to the kernel after 2.6.11 is released, allowing the hotplug-ng programs to be made even smaller.
But what about
One wrinkle on the whole hotplug process is the |
Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.