[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170830024703.GA17175@jagdpanzerIV.localdomain>
Date: Wed, 30 Aug 2017 11:47:03 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Pavel Machek <pavel@....cz>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Petr Mladek <pmladek@...e.com>, Jan Kara <jack@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Jiri Slaby <jslaby@...e.com>, Andreas Mohr <andi@...as.de>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: printk: what is going on with additional newlines?
On (08/29/17 19:31), Joe Perches wrote:
[..]
> > the idea is not to do printk() on that seq buffer at all, but to
> > log_store(), atomically, seq buffer messages
> >
> > spin_lock(&logbuf_lock)
> > while (offset < seq_buffer->len) {
> > ...
> > log_store(seq->buffer + offset);
> > ...
> > }
> > spin_unlock(&logbuf_unlock)
>
> Why?
>
> What's wrong with a simple printk?
> It'd still do a log_store.
sure, it will. but in separate logbuf entries, and between two
consequent printk calls on the same CPU a lot of stuff can happen:
IRQs->printks, rescheduling->printks, etc. etc. (not to mention
concurrent printks from other CPUs) so what people want to have is
to have a way to make several printks appear next to each other in
the logs (dmesg or serial log). Tetsuo wants this, for instance,
for OOM reports and backtraces. SCIS/ATA people want it as well.
-ss
Powered by blists - more mailing lists