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

Re: [PATCH v2 2/3] xen/rcu: simplify RCU implementation


  • To: "Roger Pau Monne" <roger@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Alejandro Vallejo" <alejandro.garciavallejo@xxxxxxx>
  • Date: Mon, 28 Sep 2026 10:31:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=JMS9JxRqfXbVA44+MvY+XQ2cAB2GHvBaMtCG+89x9A4=; b=dLoz2N9vABWxCJgEXUeu1Qfvy2COCDy5vVhN6X0dLF5+5Id+aNLfpeqSfDKjGXQVPDuqyi5oQnjUwNQ/n9c9xrvuRvyaRudD4ocsBoc3XF4i/GJDSKxgWRZnShHdsBxH49XCAqDt7UKmxfv7RnfBYZw/2nEr7D/w10BUVTGnNTRpCAi0I0Tp//IlM9B+hE5bSFeztNndOiQ8ZEB16W5f3k0hakiIJ2DL98QRN7VR8YgCbWGb1BVvwRaXh1FQGBF1fRTed24rQ/4X93BnwZLfkfM40rVKCvbJQxFeaUm96IQeH0b2sPxuVR0p/Zay2NbM5gg8rcKzQRbLHfuUYT+Egg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=siWATHASvS4iRyzXRbl36/J2cizqnkeUOO3wNekifmgvwXzxWSed0vaz8ncOFocT3QbZE/+o0ora1ujUI/uaUxxP+SdsLB6Dm6+Pejo25+ycxZV1GPidsNI9046j7mDa2PX32oUDRHVF64YhAHByocdsjA2rBxX8VRQEyHslPYWBCS0HIu5b24e6PZ6a633bPmDJGm25anOB+FVUUWU7G0vjx3sS0kdYHD/ztOoJzVfVhfFhRQPXS4XoEfbvbC/4Q1WGr9KYuEN/C5Qm0e54ZAyEsecLDDD8gdAFWAlv6bq14Ff4TLR8wo21URbBlBtBR5Uj45fwnmRlONUB4Imjzg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>, "Michal Orzel" <michal.orzel@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 28 Sep 2026 08:31:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri Sep 25, 2026 at 6:30 PM CEST, Roger Pau Monne wrote:
> The current implementation has two shortcomings for certain Xen usages:
>
>  * When using the null scheduler it's possible for a CPU to never enter Xen
>    context.  A CPU not entering Xen context can block other CPUs from
>    executing RCU callbacks, as there will be no quiescent state observed if
>    the CPU doesn't enter Xen context.
>
>  * If a certain amount of callbacks are pending, RCU will try to force a
>    quiescent state, by sending an IPI to remote CPUs.  This causes unwanted
>    interference.
>
> Keep track of the RCU epoch when a callback was added, and only execute it
> once all CPUs are either outside of RCU critical regions, or any CPUs
> inside of RCU critical regions have entered such past the epoch when the
> callback was queued.  Knowing whether a CPU is inside a RCU critical region
> is done based on the CPU rcu_lock_cnt value.
>
> This removes the grace/quiescent period state tracking entirely: the
> control block, the per-CPU quiescent bookkeeping, the batch lists and the
> forced-quiescent-state IPI all go away.  As a result no RCU-driven IPIs are
> sent to remote CPUs, and callback progress no longer depends on every CPU
> passing through Xen context.
>
> Signed-off-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>

All review I already did on this was on the applied patch. I find the
diff a bit too unwieldy. Perhaps it might be good to add the new logic
on top first, and then remove the prior logic.

Something like:

#define RCU_USES_EPOCH 1

#ifdef RCU_USES_EPOCH
<old rcu specifics>
#else
<new rcu specifics>
#endif

... then have a last patch that drops old RCU code. Structs, older
functions, etc can stay until then, because they'll be removed later.
It's just a means of shrinking the diff in order to make it tractable.

My .02, anyway. Perhaps you already tried and it's terrible anyhow.

Cheers,
Alejandro



 


Rackspace

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