All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmukhin@ford.com
To: Teddy Astie <teddy.astie@vates.tech>
Cc: dmukhin@ford.com, xen-devel@lists.xenproject.org,
	andrew.cooper3@citrix.com, anthony.perard@vates.tech,
	jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
	roger.pau@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
Date: Fri, 17 Jul 2026 19:34:39 -0700	[thread overview]
Message-ID: <alrmP1FHd7AzlBxC@kraken> (raw)
In-Reply-To: <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>

On Thu, Jul 16, 2026 at 11:59:34AM +0200, Teddy Astie wrote:
> Le 15/07/2026 à 22:24, dmukhin@ford.com a écrit :
> > From: Denis Mukhin <dmukhin@ford.com>
> > 
> > Introduce CONFIG_PRINTK_RATELIMIT_MS and CONFIG_PRINTK_RATELIMIT_BURST
> > for configuring rate-limiting policy at the compile time.
> > 
> > Use symbols for global rate-limiting initialization in the console driver.
> > 
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> > Changes since v2:
> > - moved rate-limiting controls to common/Kconfig
> > ---
> >   xen/common/Kconfig         | 29 +++++++++++++++++++++++++++++
> >   xen/drivers/char/console.c |  6 ++++--
> >   2 files changed, 33 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> > index da80fdba8469..fd22806884e0 100644
> > --- a/xen/common/Kconfig
> > +++ b/xen/common/Kconfig
> > @@ -672,4 +672,33 @@ config PM_STATS
> >   	  Enable collection of performance management statistics to aid in
> >   	  analyzing and tuning power/performance characteristics of the system
> > +menu "Console rate-limiting"
> > +
> > +config PRINTK_RATELIMIT_MS
> > +	int "printk rate-limiting time window (milliseconds)"
> > +	default 5000
> > +	help
> > +	  Specifies the time window, in milliseconds, for rate-limited printk
> > +	  messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will be
> > +	  printed within this window.
> > +
> > +	  Setting this value to 0 disables rate-limiting entirely.
> > +
> > +	  Rate-limited messages are those controlled by the `loglvl` and
> > +	  `guest_loglvl` command-line parameters.
> > +
> > +config PRINTK_RATELIMIT_BURST
> > +	int "printk rate-limited message burst size"
> > +	default 10
> > +	help
> > +	  Defines the maximum number of rate-limited printk messages that may be
> > +	  printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
> > +
> > +	  Setting this value to 0 disables rate-limiting entirely.
> > +
> > +	  Rate-limited messages are those controlled by the `loglvl` and
> > +	  `guest_loglvl` command-line parameters.
> > +
> > +endmenu
> > +
> >   endmenu
> 
> Given that setting 0 to either will disable rate limiting, would it be
> preferable instead to have a more general PRINTK_RATELIMIT toggle, where :
> 
> Setting it to true would enable configuration of ms and burst (rejecting 0
> if possible).
> Setting it to false would set both to 0 hence disabling rate limiting by
> default.
> 
> And we do something like
> 
> static const unsigned int printk_ratelimit_ms =
>   IS_ENABLED(CONFIG_PRINTK_RATELIMIT) ? CONFIG_PRINTK_RATELIMIT_MS : 0;
> 
> (similarly for burst)
> 
> ?

I can hide both selectors behind CONFIG_PRINTK_RATELIMIT.


  parent reply	other threads:[~2026-07-18  2:35 UTC|newest]

Thread overview: 17+ 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-18  2:55     ` dmukhin
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-18  2:34     ` dmukhin [this message]
2026-07-18  2:54       ` dmukhin
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
2026-07-18  2:29     ` dmukhin

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=alrmP1FHd7AzlBxC@kraken \
    --to=dmukhin@ford.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=teddy.astie@vates.tech \
    --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.