How not to write kernel messages

August 11, 2012

Suppose that you reboot your Ubuntu 12.04 Linux machine and see, among the kernel boot messages, the following:

Yama: becoming mindful.

Perhaps you've heard something about Yama and would like to understand what this means, perhaps you're looking for boot anomalies in general because of an odd problem you're having, or even perhaps you'd just like to understand your kernel's boot sequence. Is this message helpful?

Of course not. For most people this is completely opaque and simply not a useful message. Even if you've got some idea of what Yama is, the best you can do is to take a guess at what this message probably means. A much better version of this message would be something like 'Yama LSM initializing', and an even better version would change the code so that it only appears after the Yama LSM actually is initialized.

(Printing this message early on is probably excusable; at least in the current Linux kernel, the Yama LSM panics the system if it can't complete the remaining initialization. I assume that the registration functions it calls are not supposed to fail, even though they can return errors.)

Linux is far from the only Unix to do this, but for various reasons the Linux kernel has taken it to new heights (or depths). Quite a few kernel messages are not written for outside people, and in fact they're often not even written for general kernel programmers; they're pretty much written for the people who are working on the particular subsystem, the sort of people who know off the top of their head what Yama is and what an in-joke message like 'Yama: becoming mindful' actually means.

I'm not advocating for a totally buttoned down style of messages and sometimes you really do need debugging messages that require so much domain expertise that there's no point in making them comprehensible to outsiders. But most of the time kernel messages don't have to be anywhere near as obscure as they are.

(I expect that this is also the kind of thing that you generally can't fix by submitting a patch, because a patch to make a kernel message 'more boring' is highly likely to be politically explosive. Changing this needs to come from a cultural shift and internal pressure, not attempts from outsiders.)

Comments on this page:

I imagine that if you did submit a patch to make the logging message more clear and informative they wouldn't bite your head off.

Documentation is one of those things that not many people enjoy doing, so if someone else is willing to document something I can't see how that would be an explosive issue. Though I suppose you might be told to google for what the message means. Still, kernel devs live and breath logic right? So if it's logical to make an opaque thing less so, then why would they have an issue with it?

By Evan Root at 2015-02-11 17:28:33:

I believe the reason why the Yama message is cryptic and 'intriguing' is because tedious committee sanitized messages such as "AppArmor: AppArmor initialized" are at odds with the core pricipal behind Ubuntu "Linux for human beings"

There are serious and solemn debates about why 'Hacking' makes the news and people care quite a bit, but and then security frameworks like SElinux are considered tedious and then ignored by people who otherwise are interested.


By Eric Swanson at 2017-04-21 13:31:25:

Your blog is now the top Google result for "Yama: becoming mindful". I'll admit, I was actually delighted to see such a silly message alongside all of the serious initialization messages. So what if it's an in joke? Are you telling me that you really understand every kernel boot message? I have been reading my dmesg and Googling things like "Calgary: Unable to locate Rio Grande table in EBDA - bailing!" all morning. It was nice to see something a bit less serious.

By mck- at 2017-08-05 15:47:01:

I was just reading dmesg logs to debug something, and saw this message for the first time. I thought it was hilarious, and intrigued me to Google around as well. Didn't find much though about its history or meaning :)

Thanks. Mint 18.3 still does this. 15 minutes lost, so far.

By K.C. at 2018-03-29 12:50:57:

Eight years later, Kernel 4.15.0 :

[ 0.024000] pid_max: default: 32768 minimum: 301
[ 0.024000] Security Framework initialized
[ 0.024000] Yama: becoming mindful.
[ 0.024000] AppArmor: AppArmor initialized


By Jesse Bye at 2020-10-14 11:57:53:

I thought the message was harmless and humorous, but for those that would like to see it improved, here's the line where you could change it:

By Andreas at 2023-01-19 08:29:22:


Linux 5.15.0-58-generic

google top hit

thank you for giving enough pointers here that I Could research things further. Also agree that messages can be phrased good - or not so good.

Written on 11 August 2012.
« Learning something from not testing jQuery 1.8's beta releases
The CPython bytecode difference between iteration and looping »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sat Aug 11 00:42:32 2012
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.