All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Xenia.Ragiadakou@amd.com, alejandro.garciavallejo@amd.com,
	Jason.Andryuk@amd.com
Subject: Re: [PATCH 0/2] Xen real-time x86
Date: Wed, 9 Jul 2025 16:10:06 +0200	[thread overview]
Message-ID: <aG54PiX4hzIAfYA6@macbook.local> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2507081000490.605088@ubuntu-linux-20-04-desktop>

On Tue, Jul 08, 2025 at 10:11:18AM -0700, Stefano Stabellini wrote:
> On Tue, 8 Jul 2025, Jan Beulich wrote:
> > On 08.07.2025 12:11, Roger Pau Monné wrote:
> > > On Mon, Jul 07, 2025 at 05:06:53PM -0700, Stefano Stabellini wrote:
> > >  Interrupt forwarding
> > > from Xen into HVM/PVH guests uses a softirq to do the injection, which
> > > means there's a non-deterministic window of latency between when the
> > > interrupt is received by Xen, as to when it's injected to the guest,
> > > because the softirq might not get processed right after being set as
> > > pending (there might be other softirqs to process, or simply Xen might
> > > be busy doing some other operation).
> > > 
> > > I think you want to look into adding a new command line option or
> > > similar, that allows selecting whether guest IRQs are deferred to a
> > > softirq for injection, or are injected as part of the processing done
> > > in the IRQ handler itself.
> > > 
> > > Otherwise there will always be a non-deterministic amount of latency
> > > on x86 w.r.t. HVM/PVH passthrough guest interrupts.  Haven't you seen
> > > some weird/unexpected variance when doing this passthrough interrupt
> > > latency measurements on x86?
> 
> While this is not great and I agree with Roger that it should be
> improved (I'll try to do so), in a well configured system I expect that
> there should be no other softirqs on the RTOS vCPU/pCPU so it shouldn't
> matter much if it is raise as a softirq or not?

Possibly - if the physical CPU where the interrupt is injected is also
the one where the target vCPU is running it won't make much of a
difference whether injection to the guest is deferred to a softirq, as
softirqs must always be processed before returning to guest context.

So I would think that when using the interrupt-follows-vCPU Xen model,
where interrupts are moved around to follow the vCPUs they target,
this extra latency would only be seen when the interrupt is delivered
to a CPU different than the one where the target guest vCPU is
running, which is never in your scenario because you pin vCPUs.

Roger.


      parent reply	other threads:[~2025-07-09 14:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08  0:06 [PATCH 0/2] Xen real-time x86 Stefano Stabellini
2025-07-08  0:07 ` [PATCH 1/2] xen/x86: don't send IPI to sync TSC when it is reliable Stefano Stabellini
2025-07-08  9:54   ` Alejandro Vallejo
2025-07-08 17:40     ` Stefano Stabellini
2025-07-08 17:53       ` Alejandro Vallejo
2025-07-08 13:24   ` Jan Beulich
2025-07-08 17:40     ` Stefano Stabellini
2025-07-09  7:04       ` Jan Beulich
2025-07-08  0:07 ` [PATCH 2/2] xen/x86: introduce AMD_MCE_NONFATAL Stefano Stabellini
2025-07-08  3:23   ` Demi Marie Obenour
2025-07-08 10:25   ` Alejandro Vallejo
2025-07-08 13:28     ` Jan Beulich
2025-07-08 17:13       ` Stefano Stabellini
2025-07-08 10:11 ` [PATCH 0/2] Xen real-time x86 Roger Pau Monné
2025-07-08 13:31   ` Jan Beulich
2025-07-08 17:11     ` Stefano Stabellini
2025-07-09  5:37       ` Jan Beulich
2025-07-10  0:44         ` Stefano Stabellini
2025-07-10  7:02           ` Roger Pau Monné
2025-07-10  8:02             ` Jan Beulich
2025-07-10 21:39               ` Stefano Stabellini
2025-07-11  1:23                 ` Demi Marie Obenour
2025-07-09 14:10       ` Roger Pau Monné [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=aG54PiX4hzIAfYA6@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=Jason.Andryuk@amd.com \
    --cc=Xenia.Ragiadakou@amd.com \
    --cc=alejandro.garciavallejo@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=stefano.stabellini@amd.com \
    --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.