LWN.net Logo

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 3, 2006 5:10 UTC (Thu) by xoddam (subscriber, #2322)
Parent article: New kernels and old distributions

Would Andrew Morton be complaining if a userspace program broke that
depended on the layout of kernel objects in /dev/kmem? The whole point
of /sys (as opposed to the now-somewhat-deprecated /proc) is that it
reflects internal kernel data structures. Which are subject to change
without notice, according policy which has been stated most vociferously
by Greg K-H himself.

This means that Linus' policy against messing with userspace interfaces
cannot meaningfully apply to sysfs, any more than to kmem. But since
sysfs has only a couple of meaningful userspace clients, namely the HAL
library and the udev daemon, which are updated more-or-less in parallel
with the kernel, the stable interface boundary moves to the library API
and the 'far side' of the daemon: its configuration files and the device
nodes created in /dev are what must remain consistent.

Whether or not udev and HAL are maintained as part of the kernel source
tree (as recently proposed), the solution to this problem is simple: if
you want to run a new kernel, update userspace packages that depend on
kernel internals correspondingly. More recent udev daemons ought to
continue to understand older kernels, so users need only keep the latest
one on their systems: this is the right place for translations as
proposed by a sibling post. But the converse obligation, that the latest
kernel should support old versions of udev and HAL, imposes *exactly* the
'stable API nonsense' that the kernel developers have declared utterly
unacceptable.

The same issue has come up before -- eg. with insmod -- and the solution
has often been not only to pull the implementation into the kernel tree
so it can be maintained properly, but actually to do the work in
kernelspace, despite an earlier preference that it be done by a user
process. I suspect there are several other pieces of code which might be
better implemented as userspace utilities maintained alongside the
kernel, rather than *inside* it.

> There are limits, however, to how many tools can be packaged
> in this way

What limit, exactly, is there on userspace packages maintained in sync
with the kernel tree? The kernel tree is already huge and growing
rapidly. The advocated solution for any project (usually an out-of-tree
driver) which begs for a stable kernel API is to bring it in-tree. Why
should that rule be any different for those userspace tools that are
necessarily coupled to kernel internals? They're usually maintained by
kernel developers anyway; wouldn't it smooth the workflow to have it all
in the same place?

Projects such as KDE and GNOME manage to maintain numerous libraries and
applications in a combined source tree and to release them together. I
can't see why AM thinks people running Fedora Core 3 should want to
upgrade to an arbitrarily recent kernel without also updating a couple of
dependencies. Does he likewise think the users should be able to upgrade
GNOME without updating any supporting packages?

The bottom line is that sysfs is a window into the interior of the
kernel, which maintains the right to change without notice. Userspace in
general cannot depend on it. udev and HAL *are* the interface and
therefore must remain current with the kernel.


(Log in to post comments)

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 3, 2006 10:58 UTC (Thu) by jschrod (subscriber, #1646) [Link]

Whether or not udev and HAL are maintained as part of the kernel source tree (as recently proposed), the solution to this problem is simple: if you want to run a new kernel, update userspace packages that depend on kernel internals correspondingly.
If you would have read the linked full email from Andrew, you would have seen:
This stuff breaks my FC3 test box and there is, afaict, no clear way for users to upgrade udev to unbreak it.
(emphasis mine). Thus, your solution doesn't seem to work.

Btw, if the patch really breaks all 10-month-old distributions, it will break currently supported SUSE distributions, too. Yet another class of users who might have problems in using (and thus testing!) current kernels.

Cheers, Joachim

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 4, 2006 4:32 UTC (Fri) by xoddam (subscriber, #2322) [Link]

> If you would have read the linked full email from Andrew,

Actually I did read it, but I missed this detail.

> you would have seen:

> > This stuff breaks my FC3 test box and there is, afaict,
> > no clear way for users to upgrade udev to unbreak it.

> (emphasis mine). Thus, your solution doesn't seem to work.

You are correct at the time of writing. I'd consider this a bug in udev
rather than the kernel. A workable solution would be sticking `uname -r`
in the path to the udev daemon binary, as suggested below and as is
currently done for modules. This would be a reasonable change for
updated kernel and udev packages to make for older distributions. People
who build their own kernels are capable of hacking such a change by hand.

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 4, 2006 8:41 UTC (Fri) by jschrod (subscriber, #1646) [Link]

I'm with you that a solution that would require kernel and udev upgrade at the same time would be workable. E.g., I run a self-compiled kernel on my laptop, to get suspend2, and I would surely find it acceptable. But my SUSE 9.2 is more than 10 month old and is therefore supposed to be hit by the introduced change by Greg -- and that I don't find acceptable without a clear upgrade path for udev... :-) (I have to say that I didn't test it the patch, but want to wait until the dust of this discussion has settled.)

The problem is not that there are possibilities to handle the change; the problem is that Greg does the change without the possibilities in place. Wasn't it Greg in his OLS talk that promoted the high quality of the kernel and wanted more users to test the latest mainstream kernels, besides the kernel developers themselves? Well, then he has to care more about user requirements and user problems, like Andrew does.

Cheers, Joachim

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 3, 2006 12:57 UTC (Thu) by smitty_one_each (subscriber, #28989) [Link]

>udev and HAL are maintained as part of the kernel source

Calibrate me if I'm off, but udev is linux-specific, whereas HAL is a Gnome desktop component, and therefore goes anywhere X goes, no?

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 3, 2006 14:57 UTC (Thu) by Sho (subscriber, #8956) [Link]

(a) HAL stands for 'Hardware Abstraction Layer'. According to its website, HAL currently depends on Linux 2.6.15 or later, as well as on udev and D-Bus. While the idea behind an abstraction layer is obviously in line with trying to get it to work on multiple backend platforms, in practice, HAL is presently tied to Linux.

(b) HAL is desktop-agnostic. It's not part of the Gnome desktop platform. HAL is hosted on Freedesktop.org. Several of the projects that participate in the Freedesktop.org effort make active use of HAL, notably KDE and Gnome.

(c) HAL does not depend on the X Window System.

Couple of links:
HAL website: http://www.freedesktop.org/wiki/Software_2fhal
HAL 0.5.8 Specification: http://webcvs.freedesktop.org/hal/hal/doc/spec/hal-spec.h...

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 4, 2006 17:36 UTC (Fri) by bfeeney (guest, #6855) [Link]

Actually there are ongoing efforts to port HAL to FreeBSD and to
OpenSolaris (the latter being headed by the Nexenta people I believe).
It's unlikely to remain a Unix thing for very long. In the meantime, KDE 4
will feature the Solid library to handle hot-plugging: it'll use HAL where
available, and system specific code otherwise. I don't think Gnome has any
specific plans as yet.

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 3, 2006 21:19 UTC (Thu) by wilck (subscriber, #29844) [Link]

This means that Linus' policy against messing with userspace interfaces cannot meaningfully apply to sysfs, any more than to kmem.

There is a huge difference between sysfs and /dev/kmem. sysfs is globally visible and has a lot of reasonable uses. For example, there are lots of tunables in sysfs that are outside the scope of udev and HAL but useful for other system applications. /dev/kmem, on the other hand, is usually only accessible to root, and useful only for kernel debugging.

But the converse obligation, that the latest kernel should support old versions of udev and HAL, imposes *exactly* the 'stable API nonsense' that the kernel developers have declared utterly unacceptable.

Perhaps the opposite is true - perhaps the 'stable API' is a more complex subject than Greg and his followers pretend? Perhaps it is not such total nonsense, after all? The discussion between Greg and Andrew is interesting in that respect: it appears that Andrew considers user space breakage more 'utterly unacceptable' than the restrictions on development progress caused by the stable sysfs API.

Keeping up with the Kroah-Hartmans (who upgrade without notice)

Posted Aug 4, 2006 4:33 UTC (Fri) by xoddam (subscriber, #2322) [Link]

> There is a huge difference between sysfs and /dev/kmem.
> sysfs is globally visible and has a lot of reasonable uses.

/dev/kmem used to have reasonable uses too, like insmod. Now insmod is
done inside the kernel, and there are no reasonable uses left for it
besides, as you say, debugging (but it is very limited even for that
purpose).

> Perhaps the opposite is true - perhaps the 'stable API' is a
> more complex subject than Greg and his followers pretend?

My point exactly -- on the one hand the 'no stable API' party wants to be
able to change internals at will, maintaining a stable interface to
userspace only, and on the other hand the primary spokesman for this
party exposes internals to userspace in such a way that changing them
*will* break userspace.

I'm suggesting that the real boundary of the stable API is on the far
side of userspace utilities like udev and modutils which *must* know
about kernel internals.

It's nice to *claim* a firm userspace/kernel boundary line, but
maintaining that boundary will mean freezing interfaces to userspace
technologies like hotplug in concrete from the very beginning. This is
not reasonable. Hotplug is *required* for suspend; suspend was wrong;
hotplug must change.

The only alternative is to do *all* interesting hardware-related work
in-kernel. Down with daemons!

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