LWN.net Logo

Removing four bytes from the kernel ABI

Removing four bytes from the kernel ABI

Posted May 24, 2012 15:57 UTC (Thu) by nevets (subscriber, #11875)
In reply to: Removing four bytes from the kernel ABI by intgr
Parent article: Removing four bytes from the kernel ABI

Well, sounds to me like the kernel didn't actually break its promised ABI -- PowerTOP didn't respect the event description so it misused the ABI.

True but unfortunately that doesn't matter. As Linus pointed out:

And if binaries don't use the interface to parse the format (or just parse it wrongly - see the fairly recent example of adding uuid's to /proc/self/mountinfo), then it's a regression.

[...]

If you made an interface that can be used without parsing the interface description, then we're stuck with the interface. Theory simply doesn't matter.

Basically it came down to the fact that we didn't push the library that parses the data strong enough. And we also made it too easy for apps to circumvent the library. Peter Zijlstra once asked me to make the field order random, to keep tools from doing this (before PowerTop actually did), but to do so would have added a high overhead to tracing, that I did not think was worth it at the time. Then when this happened, I realized that I was mistaken.

If the author of PowerTop wasn't a kernel developer, I highly doubt we would have had this problem. But the author was and for him, it was much easier to look at what the kernel code was doing and access it directly than to create a parsing library. I do not blame him for this. It was our fault for letting this happen.


(Log in to post comments)

Removing four bytes from the kernel ABI

Posted May 25, 2012 0:20 UTC (Fri) by giraffedata (subscriber, #1954) [Link]

Linus:
If you made an interface that can be used without parsing the interface description, then we're stuck with the interface.

Linus is always oversimplifying things. I know he doesn't really believe that the kernel is stuck with an interface just because kernel developers made it possible for someone to consider it to exist. It simply isn't technically possible to prevent someone from using an intended interface that wasn't intended.

Linus' real and more reasonable policy would probably be better exemplified by:

If an important user found a way to use your interface without parsing the interface description, then we're stuck with the interface.

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