linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux.git: printk() problem
Date: Tue, 25 Oct 2016 10:42:56 -0400	[thread overview]
Message-ID: <20161025144256.ngfxchitby4xpxno@home.goodmis.org> (raw)
In-Reply-To: <CA+55aFw1Z95Lfefr1PfZW17qj9zjv+-bZ-oPESTNk+tbAEVrhQ@mail.gmail.com>

On Sun, Oct 23, 2016 at 11:11:18AM -0700, Linus Torvalds wrote:
> 
> For example, one of the really historical uses for partial lines is this:
> 
>        pr_info("Checking 'hlt' instruction... ");
> 
>        if (!boot_cpu_data.hlt_works_ok) {
>                pr_cont("disabled\n");
>                return;
>        }
>        halt();
>        halt();
>        halt();
>        halt();
>        pr_cont("OK\n");
> 
> and the point was that there used to be some really old i386 machines
> that hung on the "hlt" instruction (probably not because of a CPU bug,
> but because of either power supply issues or some DMA issues).
> 
> To support that, we really *had* to print out the continuation lines
> even when they were partial. And that complicates the printk logic a
> lot.

Note, my ftrace start up tests still does exactly this (e.g.):

	pr_info("Testing dynamic ftrace ops: #%d: ", cnt);

	[ do lots of testing ]

	printk(KERN_CONT "PASSED\n");

Previously a change was made to buffer lines without \n, and I wasted an
entire day debugging why a crash happened because I was looking at the wrong
test.

-- Steve

> 
> Now, that "hlt" case is long long gone, and maybe we should just say
> "screw that". It would be really quite easy to say "we don't print out
> continuation lines immediately, we just buffer them for 0.1s instead,
> and KERN_CONT only works for things that really happen more or less
> immediately".
> 
> Maybe that really is the right answer. Because the original cause of
> us having to bend over backwards in this case is really no longer
> there. And it would simplify printk a *lot*.
> 
> Let me whip up a minimal patch for you to try.

      parent reply	other threads:[~2016-10-25 14:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12 13:30 linux.git: printk() problem Tetsuo Handa
2016-10-12 14:35 ` Michal Hocko
2016-10-12 16:08   ` Joe Perches
2016-10-13  6:26     ` Michal Hocko
2016-10-13  9:29       ` Joe Perches
2016-10-13 10:04         ` Michal Hocko
2016-10-13 10:20           ` Joe Perches
2016-10-13 11:06             ` Michal Hocko
2016-10-12 15:47 ` Linus Torvalds
2016-10-12 16:16   ` Joe Perches
2016-10-12 16:54     ` Linus Torvalds
2016-10-12 18:50       ` [PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT Joe Perches
2016-10-13 21:59         ` Rafael J. Wysocki
2016-10-23  9:22   ` linux.git: printk() problem Geert Uytterhoeven
2016-10-23 18:11     ` Linus Torvalds
2016-10-23 19:06       ` Joe Perches
2016-10-23 19:32         ` Linus Torvalds
2016-10-23 19:46           ` Linus Torvalds
2016-10-24 11:15             ` Geert Uytterhoeven
2016-10-24 14:08             ` Sergey Senozhatsky
2016-10-24 14:23               ` Sergey Senozhatsky
2016-10-24 17:54               ` Linus Torvalds
2016-10-24 17:55                 ` Linus Torvalds
2016-10-25  1:55                   ` Sergey Senozhatsky
2016-10-25  2:06                     ` Linus Torvalds
2016-10-25  2:22                       ` Linus Torvalds
2016-10-25  4:06                         ` Sergey Senozhatsky
2016-10-25  4:13                           ` Joe Perches
2016-10-25  4:15                           ` Linus Torvalds
2016-10-25  4:44                             ` Sergey Senozhatsky
2016-10-25 14:44                         ` Petr Mladek
2016-11-09 15:47                         ` Petr Mladek
2016-10-25  2:24                     ` Sergey Senozhatsky
2016-10-23 20:33           ` Joe Perches
2016-10-23 21:13             ` Linus Torvalds
2016-10-25 14:42       ` Steven Rostedt [this message]

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=20161025144256.ngfxchitby4xpxno@home.goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --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).