All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Chris Down <chris@chrisdown.name>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [RFC PATCH] printk: console: Allow each console to have its own loglevel
Date: Thu, 19 May 2022 09:26:37 +0200	[thread overview]
Message-ID: <CAMuHMdU2tUU6FAM-nK9oxd0GwcO3WwvZp9Um4=w5By+N0P0kXA@mail.gmail.com> (raw)
In-Reply-To: <YoUBh5BSsURDO71Z@chrisdown.name>

Hi Chris,

On Wed, May 18, 2022 at 4:27 PM Chris Down <chris@chrisdown.name> wrote:
> [Once the goals of this patch are generally agreed upon, it can be split
> out further with more detailed changelogs if desired.]
>
> Consoles can have vastly different latencies and throughputs. For
> example, writing a message to the serial console can take on the order
> of tens of milliseconds to get the UART to successfully write a message.
> While this might be fine for a single, one-off message, this can cause
> significant application-level stalls in situations where the kernel
> writes large amounts of information to the console.
>
> This means that while you might want to send at least INFO level
> messages to (for example) netconsole, which is relatively fast, you may
> only want to send at least WARN level messages to the serial console.
> Such an implementation would permit debugging using the serial console
> in cases that netconsole doesn't receive messages during particularly
> bad system issues, while still keeping the noise low enough to avoid
> inducing latency in userspace applications. This patch adds such an
> interface, extending the existing console loglevel controls to allow
> each console to have its own loglevel.

Thanks, this looks like an interesting idea!

> --- a/Documentation/admin-guide/serial-console.rst
> +++ b/Documentation/admin-guide/serial-console.rst
> @@ -17,7 +17,7 @@ use for console output.
>
>  The format of this option is::
>
> -       console=device,options
> +       console=device,options/loglevel
>
>         device:         tty0 for the foreground virtual console
>                         ttyX for any other virtual console
> @@ -32,15 +32,23 @@ The format of this option is::
>                         and F is flow control ('r' for RTS). Default is
>                         9600n8. The maximum baudrate is 115200.
>
> +       loglevel:       optional. a number can be provided from 0
> +                       (LOGLEVEL_EMERG) to 8 (LOGLEVEL_DEBUG + 1), and
> +                       messages below that will be emitted onto the console as
> +                       they become available.
> +
>  You can specify multiple console= options on the kernel command line.
>  Output will appear on all of them. The last device will be used when
>  you open ``/dev/console``. So, for example::
>
> -       console=ttyS1,9600 console=tty0
> +       console=ttyS1,9600/5 console=tty0
>
>  defines that opening ``/dev/console`` will get you the current foreground
> -virtual console, and kernel messages will appear on both the VGA
> -console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
> +virtual console, and kernel messages will appear on both the VGA console and
> +the 2nd serial port (ttyS1 or COM2) at 9600 baud. The optional loglevel "5"
> +indicates that this console will emit messages more serious than
> +LOGLEVEL_NOTICE (that is, LOGLEVEL_WARNING and below, since more serious
> +messages have lower ordering).
>
>  Note that you can only define one console per device type (serial, video).

All of the above options are appropriate for "classic" systems,
where the console device is selected using the "console=" option.

On systems using Device tree, the serial console device is selected
using the "chosen/stout-path" property in DT, and the graphical
console is usually auto-detected and auto-enabled through DRM.
Do you envision a way to specify a specific console loglevel on the
kernel command line on such systems?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2022-05-19  7:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 14:24 [RFC PATCH] printk: console: Allow each console to have its own loglevel Chris Down
2022-05-18 14:32 ` Chris Down
2022-05-18 15:34 ` Greg Kroah-Hartman
2022-05-18 19:46   ` Chris Down
2022-05-18 19:54     ` Greg Kroah-Hartman
2022-05-18 20:27       ` Chris Down
2022-05-19  7:04         ` Greg Kroah-Hartman
2022-05-19 14:12           ` Chris Down
2022-05-19 14:35             ` Greg Kroah-Hartman
2022-05-19 15:08               ` Chris Down
2022-05-19 15:24                 ` Greg Kroah-Hartman
2022-05-19 15:25                 ` Greg Kroah-Hartman
2022-05-19 15:55                   ` Chris Down
2022-05-19 17:45                     ` Greg Kroah-Hartman
2022-05-19 17:55                       ` Chris Down
2022-05-24  9:19     ` Petr Mladek
2022-05-30 10:48       ` [OFFLIST] " Chris Down
2022-05-30 10:49         ` Chris Down
2022-05-19  4:48 ` kernel test robot
2022-05-19  7:26 ` Geert Uytterhoeven [this message]
2022-05-19 14:37   ` Chris Down
2022-05-19 17:48     ` Geert Uytterhoeven
2022-05-19 18:05       ` Chris Down
2022-05-19 13:59 ` [printk] 6f922c8d53: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2022-05-19 13:59   ` [printk] 6f922c8d53: BUG:kernel_NULL_pointer_dereference, address kernel test robot

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='CAMuHMdU2tUU6FAM-nK9oxd0GwcO3WwvZp9Um4=w5By+N0P0kXA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=chris@chrisdown.name \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.