Re: [PATCH] printk: inject caller information into the body of message

From: Sergey Senozhatsky
Date: Sun Sep 30 2018 - 22:37:34 EST


On (09/29/18 20:15), Tetsuo Handa wrote:
>
> Because there is no guarantee that memory information is dumped under the
> oom_lock mutex. The oom_lock is held when calling out_of_memory(), and it
> cannot be held when reporting GFP_ATOMIC memory allocation failures.

IOW, static pr_line buffer needs additional synchronization for OOM. Correct?

If we are about to have a list of printk buffers then we probably can
define a list of NR_CPUS cont buffers. And we probably can reuse the
existing struct cont for buffered printk, having 2 different struct-s
for the same thing - struct cont and struct printk_buffer - is not very
cool.

> But I don't want line buffered printk() API to truncate upon out of
> space for line buffered printk() API.

All printk()-s are limited by LOG_LINE_MAX. Buffered printk() is not
special.

-ss