|
|
Log in / Subscribe / Register

Quotes of the week

Quotes of the week

Posted Feb 16, 2013 4:55 UTC (Sat) by viro (subscriber, #7872)
In reply to: Quotes of the week by Cyberax
Parent article: Quotes of the week

*snort*

Funny, and here I thought that fraction of kernel developers among the users of tracepoints is going to be higher than that among the users of syscalls...

And no, I don't have a problem with sane syscalls being introduced - see e.g. open-by-fhandle story. What I *do* have a problem with is review-free channels for introducing new ABIs. Somebody will end up paying the price anyway; I have zero sympathy for people complaining about the cost of introducing a new syscall - all that <gasp> review, dealing with objections, etc., because if they do not pay it, we will. And we'll be paying it forever - desktop crowd feels free to play the ABI incompatibility of the week games, but kernel-side it's not going to be acceptable.

FWIW, I have learnt (and quite painfully at that) that

* optional stuff isn't. "It's optional, don't enable it if you don't like it" as an excuse for getting a shitty code in has grown very old. It might be optional at the moment of introduction, but once it's in, it's granted all the stability warranties and by the time somebody comes and makes it very much non-optional it's far too late to do it right.

* single-consumer APIs suck. "It's just for our project" tends to be a codeword for "we make tons of assumptions about the way it'll be used", with everything that follows from that. C.f. dnotify and samba. Or adjtimex(2) and ntp (don't look at the structure being passed or biarch issues caused by it unless you want to take the second look at your dinner). Et sodding cetera - the ugliest crap comes from the stuff with small group of projects in control of the interface.

* hooks belong in tender bits of anatomy of those who are trying to introduce them. "Oh, just have our code executed every time you go here" suffers from a simple defect - very few things are naturally expressed that way. Odds are, whatever analysis of the code they are inserting the hooks into is (a) incomplete; (b) not shared with maintainers of that code; (c) makes very subtle assumptions about e.g. locking environment. Sure, for short-term debugging they are wonderful - who hadn't done "call this function here, here and here" while debugging some crap? Fine as long as you don't expect to carry that set (and those of hell knows how many other people) in your tree for years...

* interfaces that are easy to use do exist; they are hellishly hard to get right, though, and most of the candidates are seriously oversold. "Oh, it's easy to deal with refcounting problems - just use kref". Right. Except that a _lot_ of kref users are seriously racy - e.g. when object can be found (and reference acquired) in some search structure, removing it from there in destructor callback requires exclusion between the final put and lookups. Textbook stuff, right? Now go grep for kref_put callbacks and see how many of them step into it. I'm not saying that forcing everyone to reinvent that wheel would be better - in this particular case it was more about lacking primitives. I'd ended up adding one such thing (kref_put_mutex()), but we still lack e.g. spinlock equivalent. And I'm very sure that we still have unfixed races on kref_put().

Tracepoints *are* easy to use. They have their problems, but they are fine as debugging tools, etc. - after all, if the code you are trying to debug/instrument/etc. changes its structure, your instrumentation-related needs are going to change. Locking change affects consistency warranties about some data? You want to change the points where you observe it anyway. Didn't get all the data you want to collect? No problem, it's easy to change the sucker. And yes, they are easier to keep track of than their open-coded equivalents. Wonderful as a tool for kernel development, actually. But exact same properties make them recipe for disaster as soon as they are treated as userland-stable interfaces. And tracepoints reaching the mainline kernel become userland-grade ABIs...


to post comments

Quotes of the week

Posted Feb 16, 2013 5:50 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

>Funny, and here I thought that fraction of kernel developers among the users of tracepoints is going to be higher than that among the users of syscalls...
It's a userspace interface, after all.

>I have zero sympathy for people complaining about the cost of introducing a new syscall - all that <gasp> review, dealing with objections, etc., because if they do not pay it, we will.
It looks like there's a problem with that, however. All too often maintainers just stonewall certain features until they become widely used (usually in a very ugly form). This has happened with an alarming amount of stuff: uprobes, yama, performance counters, suspend blockers and other Android stuff, and now DBUS.

So it's understandable that some developers might not want to even start interacting with the kernel community. For example, I'd added several ugly hacks in the OOM killer to get OOM event notification functionality for our internal project. It was done in a couple of weekends and it works just fine (except that the kernel often crashes by itself in OOM conditions, but that's another story). I don't even want to contemplate getting it into the mainline kernel - I lose all desire to do it just by reading about the past attempts.

Certainly, Linux is a very successful project. But it still might be worthwhile to look at the cases where there's a significant friction between kernel developers and their downstream users. Developers who speak in absolutes (like "I'll NAK all tracepoints") certainly don't help there.

Quotes of the week

Posted Feb 20, 2013 4:25 UTC (Wed) by daniel (guest, #3181) [Link]

"Certainly, Linux is a very successful project."

Linux is indeed a successful project, arguably the most successful operating system in history. That does not mean that Linux is completely free of crap design or pathetically subpar implementations, or that certain high profile contributers never indulge in a little hubris from time to time.


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