From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org (Andrew Morton) Date: Tue, 5 Jun 2012 14:28:26 -0700 Subject: [PATCH 0/8] Rework KERN_ In-Reply-To: References: Message-ID: <20120605142826.d92316a0.akpm@linux-foundation.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 5 Jun 2012 02:46:29 -0700 Joe Perches wrote: > KERN_ currently takes up 3 bytes. > Shrink the kernel size by using an ASCII SOH and then the level byte. > Remove the need for KERN_CONT. > Convert directly embedded uses of <.> to KERN_ What an epic patchset. I guess that saving a byte per printk does make the world a better place, and forcibly ensuring that nothing is dependent upon the internal format of the KERN_foo strings is nice. Unfortunately the thing is part of the kernel ABI: echo "<4>foo" > /dev/kmsg devkmsg_writev() does weird and wonderful things with facilities/levels. That function incorrectly returns "success" when copy_from_user() faults, btw. It also babbles on about LOG_USER and LOG_KERN without ever defining these things. I guess they're userspace-only concepts and are hardwired to 0 and 1 in the kernel. Or not. So what to do about /dev/kmsg? I'd say "nothing": we retain "" as the externally-presented kernel format for a facility level, and the fact that the kernel internally uses a different encoding is hidden from userspace. And if the user does echo "\0014foo" > /dev/kmsg then I guess we should pass it straight through, retaining the \0014. But from my reading of your code, this doesn't work - vprintk_emit() will go ahead and strip and interpret the \0014, evading the stuff which devkmsg_writev() did.