public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: pierre kuo <vichy.kuo@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	rostedt@goodmis.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC V2] printk: add warning while drop partial text in msg
Date: Wed, 4 Oct 2017 15:28:17 +0200	[thread overview]
Message-ID: <20171004132817.GK20084@pathway.suse.cz> (raw)
In-Reply-To: <CAOVJa8H-8-Oh=1NZRj1EZYeVzmAeozHZDf2LSZ3qYX1O7HDUdw@mail.gmail.com>

On Wed 2017-09-27 21:59:52, pierre kuo wrote:
> hi:
> > printk_deferred("%s", local_string[2048]) makes no sense anyway,
> > since we limit the message size to 1024 - HEADER chars in
> > vprintk_emit()  // see static char textbuf[LOG_LINE_MAX].
> 
> We use the example in this mail since we try to collect the message at
> different places in our driver.
> And batch to printk for saving individual output time and group
> message together.

I wonder what is the motivation for the extra buffering. Did you
have troubles with direct printk() calls? For example, because
of performance, mixed messages, deadlocks?

Note that any buffering is potentially dangerous. You might miss
the messages if the system dies before they are flushed. Also
you might lose messages if the buffer is too small.


> > I'm not quite following what were you trying to prove, sorry.
> >does any function in the upstream kernel printk()-s buffers
> >larger than LOG_LINE_MAX? which one?
> 
> You are correct.
> The upstream kernel printk()-s buffers are indeed smaller LOG_LINE_MAX
> and not with multi "\n" like this example did.

You might go around this by flushing the buffer line by line.
Well, it might get quite complicated, see printk_safe_flush_buffer().
Another question is if the buffering makes sense then.

Best Regards,
Petr

  parent reply	other threads:[~2017-10-04 13:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 13:37 [RFC V2] printk: add warning while drop partial text in msg pierre Kuo
2017-08-01  2:43 ` Sergey Senozhatsky
2017-08-10 16:26   ` pierre kuo
2017-08-10 16:55     ` pierre kuo
2017-08-16  9:21       ` Petr Mladek
2017-08-17  1:05       ` Sergey Senozhatsky
2017-09-12  6:07         ` pierre kuo
2017-09-18  9:39           ` Sergey Senozhatsky
2017-09-18 10:00             ` Joe Perches
2017-09-18 10:08               ` Sergey Senozhatsky
2017-09-27 13:59             ` pierre kuo
2017-09-30  3:14               ` Sergey Senozhatsky
2017-10-04 13:28               ` Petr Mladek [this message]
2017-10-17 17:10                 ` pierre kuo
2017-10-18  1:07                   ` Sergey Senozhatsky
2017-10-04 13:17           ` Petr Mladek
2017-10-17 17:07             ` pierre kuo

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=20171004132817.GK20084@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=vichy.kuo@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox