From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Henry Wang <Henry.Wang@arm.com>,
Community Manager <community.manager@xenproject.org>,
George Dunlap <george.dunlap@citrix.com>,
Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v3] x86/x2apic: introduce a mixed physical/cluster mode
Date: Fri, 3 Nov 2023 16:34:17 +0100 [thread overview]
Message-ID: <ZUUS-fzShqxOs5IO@macbook> (raw)
In-Reply-To: <93fc77ad-8696-4d83-b916-e47f883ac366@citrix.com>
On Fri, Nov 03, 2023 at 03:10:18PM +0000, Andrew Cooper wrote:
> On 03/11/2023 2:45 pm, Roger Pau Monne wrote:
> > The current implementation of x2APIC requires to either use Cluster Logical or
>
> I'd suggest starting with "Xen's current ..." to make it clear that this
> is our logic, not a property of x2APIC itself.
>
> > Physical mode for all interrupts. However the selection of Physical vs Logical
> > is not done at APIC setup, an APIC can be addressed both in Physical or Logical
> > destination modes concurrently.
> >
> > Introduce a new x2APIC mode called mixed, which uses Logical Cluster mode for
> > IPIs, and Physical mode for external interrupts, thus attempting to use the
> > best method for each interrupt type.
> >
> > Using Physical mode for external interrupts allows more vectors to be used, and
> > interrupt balancing to be more accurate.
> >
> > Using Logical Cluster mode for IPIs allows less accesses to the ICR register
>
> s/less/fewer/
>
> > when sending those, as multiple CPUs can be targeted with a single ICR register
> > write.
> >
> > A simple test calling flush_tlb_all() 10000 times in a tight loop on a 96 CPU
> > box gives the following average figures:
> >
> > Physical mode: 26617931ns
> > Mixed mode: 23865337ns
> >
> > So ~10% improvement versus plain Physical mode. Note that Xen uses Cluster
> > mode by default, and hence is already using the fastest way for IPI delivery at
> > the cost of reducing the amount of vectors available system-wide.
>
> 96 looks suspiciously like an Intel number. In nothing else, you ought
> to say which CPU is it, because microarchitecture matters. By any
> chance can we try this on one of the Bergamos, to give us a datapoint at
> 512?
Let me see if I can grab the only one that's not broken.
Those figures are from an Intel IceLake IIRC. Cluster mode is the
default, so this change shouldn't effect the performance of builds
that use the default settings.
> > diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
> > index eac77573bd75..cd9286f295e5 100644
> > --- a/xen/arch/x86/Kconfig
> > +++ b/xen/arch/x86/Kconfig
> > @@ -228,11 +228,18 @@ config XEN_ALIGN_2M
> >
> > endchoice
> >
> > -config X2APIC_PHYSICAL
> > - bool "x2APIC Physical Destination mode"
> > +choice
> > + prompt "x2APIC Destination mode"
>
> "x2APIC Driver default" is going to be more meaningful to a non-expert
> reading this menu entry, IMO.
I will leave the helps as-is.
> > +};
> > +
> > static int cf_check update_clusterinfo(
> > struct notifier_block *nfb, unsigned long action, void *hcpu)
> > {
> > @@ -220,38 +248,56 @@ static struct notifier_block x2apic_cpu_nfb = {
> > static int8_t __initdata x2apic_phys = -1;
> > boolean_param("x2apic_phys", x2apic_phys);
> >
> > +enum {
> > + unset, physical, cluster, mixed
> > +} static __initdata x2apic_mode = unset;
> > +
> > +static int __init parse_x2apic_mode(const char *s)
>
> cf_check
I'm probably confused, but other users of custom_param() do have the
cf_check attribute, see parse_spec_ctrl() for example.
Thanks, Roger.
next prev parent reply other threads:[~2023-11-03 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 14:45 [PATCH v3] x86/x2apic: introduce a mixed physical/cluster mode Roger Pau Monne
2023-11-03 15:10 ` Andrew Cooper
2023-11-03 15:34 ` Roger Pau Monné [this message]
2023-11-03 15:38 ` Roger Pau Monné
2023-11-03 15:44 ` Andrew Cooper
2023-11-03 15:56 ` Roger Pau Monné
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=ZUUS-fzShqxOs5IO@macbook \
--to=roger.pau@citrix.com \
--cc=Henry.Wang@arm.com \
--cc=andrew.cooper3@citrix.com \
--cc=community.manager@xenproject.org \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--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.