lkml.org 
[lkml]   [2020]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] printk: Add loglevel for "do not print to consoles".
From
Date
On 2020/04/28 21:18, Michal Hocko wrote:
> On Tue 28-04-20 20:33:21, Tetsuo Handa wrote:
>> On 2020/04/27 15:21, Sergey Senozhatsky wrote:
>>>> KERN_NO_CONSOLES is for type of messages where "saved for later analysis" is
>>>> important but "printed for immediate notification" is not important.
>>>> In other words, KERN_NO_CONSOLES is NOT for dying messages where "printed for
>>>> immediate notification" is important.
>>>
>>> per-console loglevel is a user configurable parameter.
>>> KERN_NO_CONSOLES is a hard-coded policy.
>>
>> But given that whether to use KERN_NO_CONSOLES is configurable via e.g. sysctl,
>> KERN_NO_CONSOLES will become a user configurable parameter. What's still wrong?
>
> How do I as a kernel developer know that KERN_NO_CONSOLES should be
> used? In other words, how can I assume what a user will consider
> important on the console?
>

Existing KERN_$LEVEL allows a user to determine whether he/she wants that message
to be printed on consoles (even if it spams his/her operation doing on consoles), and
at the same time constrains that user whether that message is saved to log files.
KERN_NO_CONSOLES allows a user to control whether he/she wants that message to be
saved to log files (without spamming his/her operation doing on consoles).

Consoles which are limited by "rows" * "columns" size should receive (ideally) up to
a few lines of messages. Printing more lines on such consoles disturbs users using
such consoles. Let alone printing one thousand lines of messages (e.g. dump_tasks())
on such consoles. Printing one thousand lines of messages on read-only consoles (e.g.
netconsole) might be fine, but non-urgent messages can afford waiting for userspace
to do more sophisticated handling (e.g. evaluate and filter).

Even without per-console loglevel feature, we can reduce spam messages for consoles
by using KERN_NO_CONSOLES. For example, send only the summary part of OOM-killer and
allocation failure messages to both consoles and log files (by not using KERN_NO_CONSOLES),
and send the non-summary part to only log files (by using KERN_NO_CONSOLES with
KERN_$LEVEL used for summary part in order to make sure that userspace daemon will
save both the summary and non-summary parts).

\
 
 \ /
  Last update: 2020-04-28 15:13    [W:0.118 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site