From: Jan Beulich <jbeulich@suse.com>
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 4/4] xen/console: reduce number of printouts in __printk_ratelimit()
Date: Thu, 16 Jul 2026 17:49:35 +0200 [thread overview]
Message-ID: <020cfca3-5558-422f-b267-e498bfdf36bf@suse.com> (raw)
In-Reply-To: <20260715201902.2984407-5-dmukhin@ford.com>
On 15.07.2026 22:19, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com>
>
> Fold several __putstr() calls into one around notification of how many
> messages have been rate-limited.
>
> Not a functional change.
>
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Hmm, the upsides and downsides aren't being discussed at all. You're ...
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -1303,15 +1303,15 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
> spin_unlock(&ratelimit_lock);
> if ( lost )
> {
> - char lost_str[10];
> + char msg[64];
> +
> + snprintf(msg, sizeof(msg),
> + "printk: %u messages suppressed\n", lost);
>
> - snprintf(lost_str, sizeof(lost_str), "%u", lost);
> /* console_lock may already be acquired by printk(). */
> rspin_lock(&console_lock);
> printk_start_of_line(CONSOLE_PREFIX);
> - __putstr("printk: ");
> - __putstr(lost_str);
> - __putstr(" messages suppressed.\n");
> + __putstr(msg);
> rspin_unlock(&console_lock);
> }
> local_irq_restore(flags);
... trading slightly smaller code size + slightly better performance for
slightly bigger stack utilization. It's not entirely obvious that this is
a good deal.
Jan
prev parent reply other threads:[~2026-07-16 15:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 20:18 [PATCH v3 0/4] xen/console: updates to rate-limiting dmukhin
2026-07-15 20:18 ` [PATCH v3 1/4] xen/console: use bool as return value from printk_ratelimit() dmukhin
2026-07-16 9:23 ` Teddy Astie
2026-07-15 20:19 ` [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter dmukhin
2026-07-16 9:50 ` Teddy Astie
2026-07-16 10:26 ` Jan Beulich
2026-07-16 15:38 ` Jan Beulich
2026-07-15 20:19 ` [PATCH v3 3/4] xen/console: add build-time rate-limiting controls dmukhin
2026-07-16 9:59 ` Teddy Astie
2026-07-16 15:44 ` Jan Beulich
2026-07-15 20:19 ` [PATCH v3 4/4] xen/console: reduce number of printouts in __printk_ratelimit() dmukhin
2026-07-16 10:02 ` Teddy Astie
2026-07-16 15:49 ` Jan Beulich [this message]
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=020cfca3-5558-422f-b267-e498bfdf36bf@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.