From: Ingo Molnar <mingo@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>, Kay Sievers <kay@vrfy.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Fengguang Wu <fengguang.wu@intel.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] printk: Revert the buffered-printk() changes for now
Date: Wed, 27 Jun 2012 07:52:55 +0200 [thread overview]
Message-ID: <20120627055255.GC14913@gmail.com> (raw)
In-Reply-To: <20120625164033.GA14000@kroah.com>
* Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Mon, Jun 25, 2012 at 10:48:54AM -0400, Steven Rostedt wrote:
> > On Mon, 2012-06-25 at 16:07 +0200, Ingo Molnar wrote:
> >
> > > System logging is an arguably secondary role, and it
> > > should not degrade printk()s primary role.
> >
> > I would argue that printk() should not play the role of
> > normal system logging. It's main role should be for boot up
> > and crashes. If devices need to log information to
> > userspace, it should really use some other means. What was
> > /sys made for anyway?
>
> Specifically not for logging. See the very old discussions of
> this a long time ago (back in the 2.5 days), if you are
> curious.
>
> printk() is the best thing we have for logging as everyone
> uses it and the information in it is exactly what userspace
> wants to know about. Because of that, why wouldn't we use it?
I agree with Greg's point there: the reality is that we have
over 50,000 printk() sites in the kernel, which is a heck of a
good source of system logging information, which we are not
going to change over to some other facility, even if we had some
marginal reasons to do it.
Just consider the life time of printk() call sites: in most
cases it gets added as a debugging printout, as a: "Hey, I just
finished reading Linux Device Drivers, 3rd Edition, and this
best ever Linux driver is now ALIVE!!" tag of success.
Then it gets extended with a few more printouts of unexpected
behavior: "So, if you got here the hardware must be buggy or you
must be doing something stupid, as the driver code sure as heck
is perfect".
Most of the printk()s get removed during productization, but
some actually make sense and remain (and some don't make sense
but just never trigger).
Very few people add printk()s as "inform the system logging
daemon about an event". The prevailing mindset is that perfect
code does not need any logging, so what is left are over 50,000
call sites of bragging and debugging code, occasionally massaged
to be somewhat user friendly.
System logging and tracing in particular can hook off this
mechanism, but we probably aren't going to change the social
role of printk()s overnight (or ever).
> Anyway, your "never buffer printk data" patch looks like the
> right solution here, I'm guessing you are going to respin it
> based on the feedback so far, right?
Acked-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
next prev parent reply other threads:[~2012-06-27 5:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-21 23:52 [PATCH] printk: Add printk_flush() to force buffered text to console Steven Rostedt
2012-06-22 7:17 ` Ingo Molnar
2012-06-22 10:45 ` Steven Rostedt
2012-06-22 8:24 ` Joe Perches
2012-06-22 10:48 ` Steven Rostedt
2012-06-22 21:54 ` Andrew Morton
2012-06-22 23:41 ` Steven Rostedt
2012-06-22 23:49 ` Andrew Morton
2012-06-22 23:56 ` Steven Rostedt
2012-06-23 6:13 ` Ingo Molnar
2012-06-23 7:44 ` Joe Perches
2012-06-25 8:45 ` Ingo Molnar
2012-06-25 16:53 ` Joe Perches
2012-06-23 11:47 ` Kay Sievers
2012-06-23 12:04 ` Fengguang Wu
2012-06-23 15:28 ` Joe Perches
2012-06-23 16:56 ` Kay Sievers
2012-06-25 9:09 ` [PATCH] printk: Revert the buffered-printk() changes for now Ingo Molnar
2012-06-25 10:06 ` Kay Sievers
2012-06-25 13:42 ` Steven Rostedt
2012-06-25 14:07 ` Ingo Molnar
2012-06-25 14:48 ` Steven Rostedt
2012-06-25 16:40 ` Greg Kroah-Hartman
2012-06-27 5:52 ` Ingo Molnar [this message]
2012-06-27 5:59 ` Joe Perches
2012-07-06 11:04 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120627055255.GC14913@gmail.com \
--to=mingo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kay@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).