mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH printk v4 8/8] printk: adjust string limit macros
Date: Fri, 6 Jan 2023 12:11:08 +0100	[thread overview]
Message-ID: <Y7gBzFWREFIyhMBX@alley> (raw)
In-Reply-To: <20230105103735.880956-9-john.ogness@linutronix.de>

On Thu 2023-01-05 11:43:35, John Ogness wrote:
> The various internal size limit macros have names and/or values that
> do not fit well to their current usage.
> 
> Rename the macros so that their purpose is clear and, if needed,
> provide a more appropriate value. In general, the new macros and
> values will lead to less memory usage. The new macros are...
> 
> PRINTK_MESSAGE_MAX:
> 
> This is the maximum size for a formatted message on a console,
> devkmsg, or syslog. It does not matter which format the message has
> (normal or extended). It replaces the use of CONSOLE_EXT_LOG_MAX for
> console and devkmsg. It replaces the use of CONSOLE_LOG_MAX for
> syslog.
> 
> Historically, normal messages have been allowed to print up to 1kB,
> whereas extended messages have been allowed to print up to 8kB.
> However, the difference in lengths of these message types is not
> significant and in multi-line records, normal messages are probably
> larger. Also, because 1kB is only slightly above the allowed record
> size, multi-line normal messages could be easily truncated during
> formatting.
> 
> This new macro should be significantly larger than the allowed
> record size to allow sufficient space for extended or multi-line
> prefix text. A value of 2kB should be plenty of space. For normal
> messages this represents a doubling of the historically allowed
> amount. For extended messages it reduces the excessive 8kB size,
> thus reducing memory usage needed for message formatting.
> 
> PRINTK_PREFIX_MAX:
> 
> This is the maximum size allowed for a record prefix (used by
> console and syslog). It replaces PREFIX_MAX. The value is left
> unchanged.
> 
> PRINTKRB_RECORD_MAX:
> 
> This is the maximum size allowed to be reserved for a record in the
> ringbuffer. It is used by all readers and writers with the printk
> ringbuffer. It replaces LOG_LINE_MAX.
> 
> Previously this was set to "1kB - PREFIX_MAX", which makes some
> sense if 1kB is the limit for normal message output and prefixes are
> enabled. However, with the allowance of larger output and the
> existence of multi-line records, the value is rather bizarre.
> 
> Round the value up to 1kB.
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

I like this.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

  reply	other threads:[~2023-01-06 11:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 10:37 [PATCH printk v4 0/8] printk: cleanup buffer handling John Ogness
2023-01-05 10:37 ` [PATCH printk v4 1/8] printk: move size limit macros into internal.h John Ogness
2023-01-05 14:48   ` Petr Mladek
2023-01-05 10:37 ` [PATCH printk v4 2/8] console: Use BIT() macros for @flags values John Ogness
2023-01-05 10:37 ` [PATCH printk v4 3/8] console: Document struct console John Ogness
2023-01-05 10:37 ` [PATCH printk v4 4/8] printk: introduce struct printk_buffers John Ogness
2023-01-05 15:06   ` Petr Mladek
2023-01-05 10:37 ` [PATCH printk v4 5/8] printk: introduce printk_get_next_message() and printk_message John Ogness
2023-01-05 15:24   ` Petr Mladek
2023-01-05 10:37 ` [PATCH printk v4 6/8] printk: introduce console_prepend_dropped() for dropped messages John Ogness
2023-01-05 16:17   ` Petr Mladek
2023-01-05 16:35     ` John Ogness
2023-01-06  9:34       ` Petr Mladek
2023-01-05 10:37 ` [PATCH printk v4 7/8] printk: use printk_buffers for devkmsg John Ogness
2023-01-05 12:14   ` John Ogness
2023-01-05 12:16     ` [PATCH printk v4 7/8 v2] " John Ogness
2023-01-06 10:39       ` Petr Mladek
2023-01-08 21:11         ` John Ogness
2023-01-05 10:37 ` [PATCH printk v4 8/8] printk: adjust string limit macros John Ogness
2023-01-06 11:11   ` Petr Mladek [this message]
2023-01-06 11:21 ` [PATCH printk v4 0/8] printk: cleanup buffer handling Petr Mladek
2023-01-07  8:18   ` John Ogness

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=Y7gBzFWREFIyhMBX@alley \
    --to=pmladek@suse.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®