public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <Martin.Bligh@us.ibm.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org, Tony.P.Lee@nokia.com,
	kessler@us.ibm.com, alan@lxorguk.ukuu.org.uk,
	Dave Jones <davej@suse.de>
Subject: Re: Event logging vs enhancing printk
Date: Mon, 08 Apr 2002 16:54:29 -0700	[thread overview]
Message-ID: <91260000.1018310069@flay> (raw)
In-Reply-To: <3CB21BFC.B3BFDACF@zip.com.au>

> I'm not aware of that being the case.  The output string
> is formed into a static buffer and then copied into the
> printk ring buffer all under spinlock_irqsave(logbuf_lock).
> 
> If there is something wrong then it would be occurring
> at the other end - where data is taken out of the ring
> and is sent to the console device(s).  The locking there
> is OK, I think?

I think we're talking about slightly different things. I'd agree that
one call to printk is atomic, and won't get interspersed with other
things, but if we output a line via multiple calls to printk, then I 
think we have a problem. Say CPU 0 executes this bit of code:

for (i=0; i<10; i++) { printk ("%d ", i); } printk("\n");

and CPU 1 does "printk("hello\n");" then instead of getting either

0 1 2 3 4 5 6 7 8 9
hello

or 

hello 
0 1 2 3 4 5 6 7 8 9

either of which would be fine, we may get

0 1 2 3 hello
4 5 6 7 8 9

which I don't think is fine - obviously the example is somewhat 
trite, but with the real instances of things that build output for one
line through multiple calls to printk, you can get unreadable garbage,
if I read the code correctly ?

M.


  reply	other threads:[~2002-04-08 23:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-08 23:18 Event logging vs enhancing printk Martin J. Bligh
2002-04-08 22:38 ` Andrew Morton
2002-04-08 23:54   ` Martin J. Bligh [this message]
2002-04-08 23:07     ` Andrew Morton
2002-04-09  2:14       ` Martin J. Bligh
2002-04-10  1:23         ` Andrea Arcangeli
2002-04-10  5:28           ` Martin J. Bligh
2002-04-11  0:15             ` Andrea Arcangeli
2002-04-09 14:34     ` Bill Davidsen
2002-04-09 14:50       ` Martin J. Bligh
2002-04-09 13:24 ` Denis Vlasenko
2002-04-09 14:42   ` Martin J. Bligh
2002-04-09 18:17     ` John Alvord
2002-04-09 14:21 ` Michel Dagenais
2002-04-09 20:49   ` Brian Beattie
2002-04-09 21:16     ` Martin J. Bligh
2002-04-09 22:28       ` Brian Beattie
2002-04-10  0:29         ` Brian Beattie
2002-04-10  1:17         ` Martin J. Bligh
2002-04-10 11:24     ` Denis Vlasenko
2002-04-11 15:11     ` Michel Dagenais
     [not found] <OF7FF94B66.91DD315B-ON88256B95.00811EF0@boulder.ibm.com>
2002-04-10  8:21 ` Zoltan Menyhart
  -- strict thread matches above, loose matches on Subject: below --
2002-04-10 13:08 Michael Holzheu
     [not found] <OF58E93BB4.1862769F-ON85256B97.0047811A@pok.ibm.com>
2002-04-10 14:19 ` sullivan
2002-04-10 15:55 Larry Kessler
2002-04-10 17:13 Francois-Xavier Kowalski
2002-04-10 19:43 Larry Kessler
     [not found] <Pine.LNX.4.33.0204111358000.20722-100000@coffee.psychology.mcmaster.ca>
2002-04-12  9:30 ` Zoltan Menyhart
2002-04-12 12:41   ` Mark Hahn
2002-04-12 14:38     ` Martin J. Bligh
2002-04-12 18:04       ` Karim Yaghmour

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=91260000.1018310069@flay \
    --to=martin.bligh@us.ibm.com \
    --cc=Tony.P.Lee@nokia.com \
    --cc=akpm@zip.com.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@suse.de \
    --cc=kessler@us.ibm.com \
    --cc=linux-kernel@vger.kernel.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