Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753122Ab2FEV2b (ORCPT ); Tue, 5 Jun 2012 17:28:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35072 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752232Ab2FEV2a (ORCPT ); Tue, 5 Jun 2012 17:28:30 -0400 Date: Tue, 5 Jun 2012 14:28:26 -0700 From: Andrew Morton To: Joe Perches Cc: Linus Torvalds , linux-arm-kernel@lists.infradead.org, linux-btrfs@vger.kernel.org, Kay Sievers , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org, Kay Sievers Subject: Re: [PATCH 0/8] Rework KERN_ Message-Id: <20120605142826.d92316a0.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1657 Lines: 43 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/