Re: [PATCH v4 2/2] printk: console: Support console-specific loglevels

From: Petr Mladek
Date: Thu Apr 27 2023 - 09:53:33 EST


On Tue 2023-04-25 16:57:49, Petr Mladek wrote:
> On Thu 2023-04-20 13:39:32, Chris Down wrote:
> > 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.
> >
> > --- /dev/null
> > +++ b/Documentation/admin-guide/per-console-loglevel.rst
> > +Console attributes
> > +~~~~~~~~~~~~~~~~~~
> > +
> > +Registered consoles are exposed at ``/sys/class/console``. For example, if you
> > +are using ``ttyS0``, the console backing it can be viewed at
> > +``/sys/class/console/ttyS0/``. The following files are available:
> > +
> > +* ``effective_loglevel`` (r): The effective loglevel after considering all
> > + loglevel authorities. For example, if the console-specific loglevel is 3, but
> > + the global minimum console loglevel [*]_ is 5, then the value will be 5.
>
> I would rather avoid this example. It confused me ;-)
>
> I thought that it was talking about the "global console loglevel"
> instead of "global minimum console loglevel". I was surprised
> that the global value was used when a console-specific one
> was defined.
>
> </more details about my confusion>
> The console loglevel defines a maximal message loglevel.
> The important thing is that it defines a "limit". Most people,
> including me, do not remember if the numbers go up or down.
> So I ignored the word "minimum". I though that it described
> the effect of the value and not a limit for the value.
>
> Also the global minimum loglevel is a really weird setting.
> I do not see much practical use for it. I guess that most
> people are not aware of this limit. I think that it creates
> more harm than good.
> </more details about my confusion>
>
> My proposal. I would replace the "confusing" paragraph with
> something like:
>
> * ``effective_loglevel`` (r): The effective loglevel after considering all
> loglevel authorities. For example, it would show the value of
> the console-specific loglevel when it is defined or the global
> console loglevel value when the console-specific one is not defined.
>
> > +* ``effective_loglevel_source`` (r): The loglevel authority which resulted in
> > + the effective loglevel being set. The following values can be present:
> > +

Please, ignore this mail. It was a draft that I sent by
mistake. Let's follow the discussion in my proper review against v5,
see https://lore.kernel.org/r/ZEp9dXwHCYNPidjC@alley

Best Regards,
Petr