LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ricky Beam <jfbeam@bluetronic.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: overlaping printk
Date: Thu, 20 May 2004 00:21:31 -0700	[thread overview]
Message-ID: <20040520002131.0afeceb9.akpm@osdl.org> (raw)
In-Reply-To: <Pine.GSO.4.33.0405191110380.14297-100000@sweetums.bluetronic.net>

Ricky Beam <jfbeam@bluetronic.net> wrote:
>
> Can anyone explain why the kernel does this on a serial console:
> 
>  C<PU0 >C2P:U M 3a:ch Mianech iCnhee cCk heExckc epEtxcieopnt: i0o0n0: 0000000000
>  0000000000000040

<looks>

<after three years, penny finally drops>

We bust the spinlock for *every* printk call.  No wonder.


diff -puN kernel/printk.c~printk-mangling-fix kernel/printk.c
--- 25/kernel/printk.c~printk-mangling-fix	2004-05-20 00:20:06.388725128 -0700
+++ 25-akpm/kernel/printk.c	2004-05-20 00:20:27.228556992 -0700
@@ -492,8 +492,10 @@ asmlinkage int printk(const char *fmt, .
 	char *p;
 	static char printk_buf[1024];
 	static int log_level_unknown = 1;
+	static int once;
 
-	if (oops_in_progress) {
+	if (oops_in_progress && !once) {
+		once = 1;
 		/* If a crash is occurring, make sure we can't deadlock */
 		spin_lock_init(&logbuf_lock);
 		/* And make sure that we print immediately */

_


  parent reply	other threads:[~2004-05-21 23:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 15:19 Ricky Beam
2004-05-19 15:26 ` Tigran Aivazian
2004-05-19 15:31   ` Ricky Beam
2004-05-19 15:39 ` Randy.Dunlap
2004-05-20  7:21 ` Andrew Morton [this message]
2004-05-19 15:55 Tuukka Toivonen
2004-05-19 16:03 ` Ricky Beam
2004-05-20 14:03   ` Ingo Molnar
     [not found] <1XBEP-Mc-49@gated-at.bofh.it>
     [not found] ` <1XBXw-13D-3@gated-at.bofh.it>
     [not found]   ` <1XWpp-zy-9@gated-at.bofh.it>
2004-05-20 14:53     ` Andi Kleen
2004-05-20 15:19       ` Ingo Molnar
2004-05-20 15:53         ` Ingo Molnar
2004-05-20 16:19           ` Andy Isaacson
2004-05-20 18:57             ` Ingo Molnar
2004-05-20 23:11               ` Andrew Morton
2004-05-21  7:00                 ` 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=20040520002131.0afeceb9.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jfbeam@bluetronic.net \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: overlaping printk' \
    /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

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).