[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: dmukhin@xxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Fri, 17 Jul 2026 19:54:13 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) 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=m2JANl6oE/gZtjo6HsYZWGgpGYZ446/ZhLlDZcE6ocw=; b=QzgeaY57zr0Hkrx8C/SLPtA3io1qCR2HNc6xYjZ7Leg9mZlnRhqSlR0dbM1eq+PyKE8W6+V4mS3PxXJqTnJT7M+aX/1REk9+yYmKcZQhAo6bJoUmoWsRsYjBqUc2ELneSS/nbgbFK7y6cai5oWzypsd5VITOVYCxoGROOLzaVoEUKaMQqPRjCEiaYEam2Y79n2LL6sFwOV9KqsgDnFvFRgYIK8c8uGOHpSRrsbOArMBjo8qOU5Dg4RdnkkHU59QD40MaTkpK7gBe5Bbol9JxrolOTfr/uVVWSeaQMuLkd+G+DtO8thQSVimAlJQckt1kADwMmb/d1gVJ+6kxN8goTw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KnN5CObOrag6QUvwqnpnjm/EOuHfzseDeKACFMQpROmexecx5TxgnVlhh83Ahy5SjYvhqlUWs7EMUugT5PEAaom4h6hXQSE9U2meFJB/hyO4JmLVGQ1VXkyH9tNPPbYWd+AfjBYf0a9nXNHq4qHIYi6cGG4nD06PmCUb+vTbAEWcMEt8kPTFyHOq3qo35ne+1qJCwW9mNeOQ6ceuhDpCWrYCE9UqEOWQXZsh+sMmPUmUjyC6rAi6jVbGpCHgp97p2XDk8cfAxz63F62ZDWmFdb3evwMu+4CN0FB1xYL3WXqDUwDIO7NBFqfnQ8VwRn3u3mCdhiOZ2K+PWlnUhfuWAg==
  • 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: Teddy Astie <teddy.astie@xxxxxxxxxx>, 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:54:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

On Fri, Jul 17, 2026 at 07:34:39PM -0700, dmukhin@xxxxxxxx wrote:
> 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.

Oh, I haven't seen Jan's feedback on that suggestion before answering.

TBH, I am fine either way, but I think just having _some_ controls is more
than enough for now given that there's no certainty on how ratelimiting will
evolve...



 


Rackspace

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