public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: "Martin J. Bligh" <Martin.Bligh@us.ibm.com>
Cc: Andrew Morton <akpm@zip.com.au>,
	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: Wed, 10 Apr 2002 03:23:28 +0200	[thread overview]
Message-ID: <20020410032328.C6875@dualathlon.random> (raw)
In-Reply-To: <3CB222AB.64005F3B@zip.com.au> <1934841354.1018293283@[10.10.2.3]>

On Mon, Apr 08, 2002 at 07:14:44PM -0700, Martin J. Bligh wrote:
> > Ah.  Yes, that will definitely happen.  We only have atomicity
> > at the level of a single printk call.
> > 
> > It would be feasible to introduce additional locking so that
> > multiple printks can be made atomic.  This should be resisted
> > though - printk needs to be really robust, and needs to have
> > a good chance of working even when the machine is having hysterics.
> > It's already rather complex.
> > 
> > For the rare cases which you cite we can use a local staging
> > buffer and sprintf, or just live with it, I suspect.
> 
> Right - what I'm proposing would be a generic equivalent of the
> local staging buffer and sprintf - basically just a little wrapper
> that does this for you, keeping a per task buffer somewhere.

That still doesn't solve the race with the interrupt handlers, you'd
need a buffer for each irq handler and one the softirq too to make
printk buffered and coeherent coherent across newlines (doable but even
more tricky and in turn less robust and less self contained).

> The reason I want to do it like this, rather than what you suggest,
> is that there are over 5000 of these "rare cases" of a printk without
> a newline, according to the IBM RAS group's code search ;-) I don't
> fancy changing that for 5000 instances (obviously some of those are
> grouped together, but the count is definitely non-trivial). I'd 
> attach the report they sent me, but it's 657K long ;-) 

Pavel omits the newline intentionally during debugging, to avoid losing
80% of the persistent stoarge in the framebuffer, but ok we could
implement a printk_flush that flushes the buffer afterwards no matte
what. Some other code may omit it by mistake, leading to the other cpus
blackholed and data lost after the buffer on the other cpus overflowed
so at least we should put a timer that spawns an huge warning if a cpu
doesn't flush the buffer in a rasonable amount of time so we can catch
those places.

Given the overcomplexity and the fact the logs should be parsed by
humans and the low probability for the race, I'm not sure if the above
is worthwhile.

If what you need is a high bandwith logging system, where with an high
frequency of posted events the races could become more likely to
trigger, printk is not the way to go for high bandwith anyways.

Andrea

  reply	other threads:[~2002-04-10  1:43 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
2002-04-08 23:07     ` Andrew Morton
2002-04-09  2:14       ` Martin J. Bligh
2002-04-10  1:23         ` Andrea Arcangeli [this message]
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=20020410032328.C6875@dualathlon.random \
    --to=andrea@suse.de \
    --cc=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