[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls


  • To: Teddy Astie <teddy.astie@xxxxxxxxxx>
  • From: dmukhin@xxxxxxxx
  • Date: Fri, 17 Jul 2026 19:34:39 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=niNsrKKGyN4n6Ip60OLL0+LAYJwgdJTFa6t0pIzmz5A=; b=yQ/igwVOC9M2ByOyrNu9R9RmreXNYfrWq6l9WlUvq8Ihz3UgnvbLgl3Ji/Aw+jpOhmAE3VUGGXWbbkbWRAFQLlHEcsEUhgI2GHSXCv0NTtWW7gNkim973umOjii1v/jymdlr4Pdq5NgHr3/ItUPJD6A1M+tqv4PjT+CScJAZ2vuKWXQYwIjcaTxfY/lLqG+LEuj+EE93/2Qy8ZYrC3EKEk/EVApQJ/jB18B3tRx/Ug4TDqeS6F0YYqrJ7HNQWZc847vFdgPnRhBvNljV5S2f6otqxzHXEsUQdXby6gJOsoym+iT8J4C2FuVOjy5Zi5Mr2oRfQQFNnDWcFrkk/Q+yYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tqKBjCy1i0W11+BsLX5OVuuQfm3dhFGVccrO2nau2h8TowPjN+h0+ieAfmcYngvl2ihTuNaTz3+EekKai7/29Hnmo+oETCwXzMYcM7eNRBI2YhrE6mqH5gO7ketFYHr5zGaZesU8VU+qXks050ax+Sl866594RB9hJMeyG316xXHoPasa6+xHvnc9iqSEXzL0Ep8FYTp9HyrWpn8COqXNObOpX6yfauauUaqaBdSa3PevJKk4LnFmdZU3QlSrrWkbn5z7ZlRN/CkmVpHLhsm7BwgwgZwVypaCyQ9qdEjcyD45J4r6kqVTApys7mx1y/CZFWORIvZWL2W6PJLHyDjbg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=fail header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: dmukhin@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx
  • Delivery-date: Sat, 18 Jul 2026 02:34:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

On Thu, Jul 16, 2026 at 11:59:34AM +0200, Teddy Astie wrote:
> Le 15/07/2026 à 22:24, dmukhin@xxxxxxxx a écrit :
> > From: Denis Mukhin <dmukhin@xxxxxxxx>
> > 
> > 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@xxxxxxxx>
> > ---
> > 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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.