From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: "Anaczkowski, Lukasz" <lukasz.anaczkowski@intel.com>
Cc: Marc Zyngier <Marc.Zyngier@arm.com>,
"tomasz.nowicki@linaro.org" <tomasz.nowicki@linaro.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"jason@lakedaemon.net" <jason@lakedaemon.net>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"Brown, Len" <len.brown@intel.com>, "pavel@ucw.cz" <pavel@ucw.cz>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"Craft, Clayton A" <clayton.a.craft@intel.com>
Subject: Re: [PATCH 2/2] x86, acpi: Handle apic/x2apic entries in MADT in correct order
Date: Wed, 9 Sep 2015 16:43:34 +0100 [thread overview]
Message-ID: <20150909154334.GA12341@red-moon> (raw)
In-Reply-To: <C1C2579D7BE026428F81F41198ADB172378BEA81@irsmsx110.ger.corp.intel.com>
On Wed, Sep 09, 2015 at 03:27:47PM +0100, Anaczkowski, Lukasz wrote:
> -----Original Message-----
> From: Lorenzo Pieralisi [mailto:lorenzo.pieralisi@arm.com]
> Sent: Wednesday, September 9, 2015 3:56 PM
>
> > On Wed, Sep 09, 2015 at 10:30:18AM +0100, Lukasz Anaczkowski wrote:
> > > () it's hard to predict how cores and threads are enumerated
>
> > So ? Why would the logical cpus order matters at all ? I guessed
> > there are probeable properties that allows the kernel to build
> > the affinity (ie topology list, shared caches, smt siblings, etc).
> > Please explain, since I am confused, to me all you need is a list
> > of existing physical ids, in whatever order they come, that's at least
> > what we need on ARM.
>
> Hi Lorenzo,
>
> Sure, let me try to explain this better.
>
> Proper (i.e. predictable way of CPU enumeration) matters for HPC software,
> (this is where I come from) as there are workloads that have some assumptions
> on CPU enumeration in order to keep cache hit ratio as high as possible.
> E.g. in KNL cores share L2 caches, and if during enumeration logical cores do not
> reflect physical cores, S/W can start affinitize threads to the same physical cores
> causing great performance impact exactly due to L2 cache misses.
> (e.g. s/w assumes that HT CPUs are separated by core count).
>
> Now, those changes would not be required if someone who have written
> APIC spec had reserved more than just 1 byte for CPU id :)
> Unfortunately, it's the case for x86 APIC ID and once it turns out there's a need
> to enumerate more than that, they added X2APIC spec which has 4 bytes for ID.
> Even that would be also fine if there were just physical cores, but with HT, ACPI
> clearly says, that first must be listed physical cores and only after that HT CPUs
> (and that's why APIC/X2APIC subtables are interleaved).
>
> When GIC spec was added, someone was smart enough to put 4 bytes from
> the begging, so you don't need to care about it on ARM :)
>
> > > () enumeration is inconsistent with how threads are enumerated on
> > > other Intel Xeon processors
>
> > And why does that matter ? Is it because userspace is making assumptions
> > on the logical cpu enumeration scheme ? I am just asking, I would
> > like to understand.
>
> Yes, HPC software makes some assumptions about CPU enumeration (as mentioned
> above) and having inconsistent enumeration between different x86 CPUs (Xeon vs Xeon Phi)
> make such s/w basically not portable.
Eh, what about "other s/w" (since MADT APIC/X2APIC parsing is unchanged
since 2009 as you mentioned) that relies on the way current enumeration is
implemented ? I will leave that to you.
/me going back to commenting the code :)
> > > So, order in which MADT APIC/X2APIC handlers are passed is
> > > reverse and both handlers are passed to be called during same MADT
> > > table to walk to achieve correct CPU enumeration.
>
> > Define "correct" please, you define the logical ordering you
> > want to achieve, you do not define why that's more "correct"
> > than the current implementation.
>
> Ok, probably 'correct' word is not the best here :)
> Does 'compatible' sound better?
No, see above :)
Thanks,
Lorenzo
next prev parent reply other threads:[~2015-09-09 15:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.DEB.2.11.1507211017590.18576 () nanos>
2015-07-30 17:43 ` [PATCH] x86, acpi: Handle xapic/x2apic entries in MADT Lukasz Anaczkowski
2015-07-30 17:43 ` [PATCH] x86, acpi: Handle lapic/x2apic " Lukasz Anaczkowski
2015-08-02 9:57 ` Thomas Gleixner
2015-08-02 12:40 ` Marc Zyngier
2015-08-03 18:26 ` Lukasz Anaczkowski
2015-08-03 18:26 ` Lukasz Anaczkowski
2015-08-26 7:04 ` Anaczkowski, Lukasz
2015-08-26 10:43 ` Marc Zyngier
2015-08-26 11:42 ` Lorenzo Pieralisi
2015-08-26 12:43 ` Marc Zyngier
2015-08-26 17:49 ` Lukasz Anaczkowski
2015-08-26 17:49 ` [PATCH] x86, arm64, " Lukasz Anaczkowski
2015-08-27 9:37 ` Lorenzo Pieralisi
2015-09-08 11:07 ` Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 0/4] Fix how CPUs are enumerated when there's more than 255 CPUs Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 1/4] acpi: rename acpi_table_parse_entries Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 2/4] x86, arm64, acpi: Added acpi_subtable_proc Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 3/4] acpi: multi proc support Lukasz Anaczkowski
2015-09-08 11:08 ` [PATCH 4/4] x86, acpi: Handle apic/x2apic entries in MADT in correct order Lukasz Anaczkowski
2015-09-08 15:22 ` Marc Zyngier
2015-09-08 16:27 ` [PATCH 0/4] Fix how CPUs are enumerated when there's more than 255 CPUs Marc Zyngier
2015-09-08 22:45 ` Al Stone
2015-09-09 7:01 ` Anaczkowski, Lukasz
2015-09-09 9:30 ` [PATCH 0/2] " Lukasz Anaczkowski
2015-09-09 9:30 ` [PATCH 1/2] acpi: Added acpi_subtable_proc to ACPI table parsers Lukasz Anaczkowski
2015-09-09 9:30 ` [PATCH 2/2] x86, acpi: Handle apic/x2apic entries in MADT in correct order Lukasz Anaczkowski
2015-09-09 13:56 ` Lorenzo Pieralisi
2015-09-09 14:27 ` Anaczkowski, Lukasz
2015-09-09 15:43 ` Lorenzo Pieralisi [this message]
2015-09-09 10:47 ` [PATCH 1/2] acpi: Added acpi_subtable_proc to ACPI table parsers Marc Zyngier
2015-09-09 13:47 ` Lukasz Anaczkowski
2015-09-09 13:47 ` [PATCH v4 0/2] Fix how CPUs are enumerated when there's more than 255 CPUs Lukasz Anaczkowski
2015-09-09 13:47 ` [PATCH v4 1/2] acpi: Added acpi_subtable_proc to ACPI table parsers Lukasz Anaczkowski
2015-09-09 13:47 ` [PATCH v4 2/2] x86, acpi: Handle apic/x2apic entries in MADT in correct order Lukasz Anaczkowski
2015-09-09 20:45 ` [PATCH v4 0/2] Fix how CPUs are enumerated when there's more than 255 CPUs Rafael J. Wysocki
2015-09-18 22:38 ` Rafael J. Wysocki
2015-08-28 8:30 ` [PATCH] x86, arm64, acpi: Handle lapic/x2apic entries in MADT Ingo Molnar
2015-09-01 8:02 ` Tomasz Nowicki
2015-09-01 12:07 ` Anaczkowski, Lukasz
2015-09-01 13:36 ` Tomasz Nowicki
2015-09-07 14:04 ` Anaczkowski, Lukasz
2015-09-08 14:44 ` Tomasz Nowicki
2015-08-26 11:03 ` [PATCH] x86, " Marc Zyngier
2015-08-26 12:56 ` Tomasz Nowicki
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=20150909154334.GA12341@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=Marc.Zyngier@arm.com \
--cc=clayton.a.craft@intel.com \
--cc=hpa@zytor.com \
--cc=jason@lakedaemon.net \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.anaczkowski@intel.com \
--cc=mingo@redhat.com \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tomasz.nowicki@linaro.org \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).