From: Chao Peng <chao.p.peng@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com,
stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com,
dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com,
xen-devel@lists.xen.org, will.auld@intel.com, keir@xen.org,
dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v6 01/14] x86: add socket_to_cpumask
Date: Wed, 6 May 2015 15:05:45 +0800 [thread overview]
Message-ID: <20150506070545.GA3458@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <5548BB0D02000078000769D8@mail.emea.novell.com>
On Tue, May 05, 2015 at 11:43:57AM +0100, Jan Beulich wrote:
> >>> On 05.05.15 at 12:25, <chao.p.peng@linux.intel.com> wrote:
> > On Tue, May 05, 2015 at 10:11:15AM +0100, Jan Beulich wrote:
> >> >>> On 05.05.15 at 09:44, <chao.p.peng@linux.intel.com> wrote:
> >> > On Fri, Apr 24, 2015 at 03:46:11PM +0100, Jan Beulich wrote:
> >> >> >>> On 23.04.15 at 11:55, <chao.p.peng@linux.intel.com> wrote:
> >> >> > @@ -717,6 +722,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
> >> >> >
> >> >> > stack_base[0] = stack_start;
> >> >> >
> >> >> > + nr_sockets = DIV_ROUND_UP(nr_cpu_ids, boot_cpu_data.x86_max_cores *
> >> >> > +
> > boot_cpu_data.x86_num_siblings);
> >> >>
> >> >> I think this is going to be problematic when there are more CPUs
> >> >> in the system than Xen can (or is told to) handle.
> >> >
> >> > After dived into the code I think there is no way we can do it
> >> > correctly, especially when we want to get the nr_sockets which counts
> >> > in the unplugged socket(s) as well.
> >>
> >> Without you explaining why it's really hard to judge whether that's
> >> indeed the case. After all we have all necessary information in hand
> >> when booting all CPUs, so I can't see why we shouldn't be able to
> >> use that information also when booting only a subset.
> >
> > My concern is the original APIC IDs do not need to be consecutive. Then
> > in such case even we do
> >
> > DIV_ROUND_UP(cpu_num_from_madt, boot_cpu_data.x86_max_cores *
> > boot_cpu_data.x86_num_siblings);
> >
> > would not be correct.
> >
> > E.g. If we have a machine like this (Each package has two cores and each
> > core has two threads but only 3 processors enumerated in MADT):
> >
> > APIC_ID Package_ID Core_ID SMT_ID
> > 1(001) 0 0 1
> > 2(010) 0 1 0
> > 4(100) 1 0 0
> >
> > Then nr_sockets = ROUND_UP( 3 / (2 * 2) ) = 1 but we do have two sockets.
>
> But that's the case regardless of how many CPUs we actually boot.
> Or what am I overlooking here?
>
So now we have two CPU numbers. One is the original processor count we
got from MADT, the other one is nr_cpu_ids we actually use.
To calculate nr_socket correctly, the former is what we need. While what
I concern here is even for the original processors we got from MADT,
can we trust they are always continuous?
I'm not sure for it. But if they are not, then the above calculation is
bogus.
Chao
next prev parent reply other threads:[~2015-05-06 7:05 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 9:55 [PATCH v6 00/14] enable Cache Allocation Technology (CAT) for VMs Chao Peng
2015-04-23 9:55 ` [PATCH v6 01/14] x86: add socket_to_cpumask Chao Peng
2015-04-24 14:46 ` Jan Beulich
2015-05-05 7:44 ` Chao Peng
2015-05-05 9:11 ` Jan Beulich
2015-05-05 10:25 ` Chao Peng
2015-05-05 10:43 ` Jan Beulich
2015-05-06 7:05 ` Chao Peng [this message]
2015-05-06 7:16 ` Jan Beulich
2015-05-06 8:06 ` Chao Peng
2015-04-23 9:55 ` [PATCH v6 02/14] x86: improve psr scheduling code Chao Peng
2015-04-23 9:55 ` [PATCH v6 03/14] x86: detect and initialize Intel CAT feature Chao Peng
2015-04-24 14:59 ` Jan Beulich
2015-05-07 9:08 ` Chao Peng
2015-05-07 11:32 ` Jan Beulich
2015-04-23 9:55 ` [PATCH v6 04/14] x86: maintain COS to CBM mapping for each socket Chao Peng
2015-04-23 9:55 ` [PATCH v6 05/14] x86: add COS information for each domain Chao Peng
2015-04-23 9:55 ` [PATCH v6 06/14] x86: expose CBM length and COS number information Chao Peng
2015-04-24 15:17 ` Jan Beulich
2015-04-23 9:55 ` [PATCH v6 07/14] x86: dynamically get/set CBM for a domain Chao Peng
2015-04-24 15:26 ` Jan Beulich
2015-04-24 15:27 ` Jan Beulich
2015-04-23 9:55 ` [PATCH v6 08/14] x86: add scheduling support for Intel CAT Chao Peng
2015-04-24 15:28 ` Jan Beulich
2015-04-23 9:55 ` [PATCH v6 09/14] xsm: add CAT related xsm policies Chao Peng
2015-04-23 9:55 ` [PATCH v6 10/14] tools/libxl: minor name changes for CMT commands Chao Peng
2015-04-23 9:55 ` [PATCH v6 11/14] tools/libxl: add command to show PSR hardware info Chao Peng
2015-04-23 9:55 ` [PATCH v6 12/14] tools/libxl: introduce some socket helpers Chao Peng
2015-05-05 12:43 ` Ian Campbell
2015-05-05 12:45 ` Ian Campbell
2015-05-06 7:06 ` Chao Peng
2015-04-23 9:55 ` [PATCH v6 13/14] tools: add tools support for Intel CAT Chao Peng
2015-05-05 12:52 ` Ian Campbell
2015-05-05 21:33 ` Dario Faggioli
2015-05-06 7:09 ` Chao Peng
2015-05-06 7:07 ` Chao Peng
2015-05-05 21:41 ` Dario Faggioli
2015-04-23 9:55 ` [PATCH v6 14/14] docs: add xl-psr.markdown Chao Peng
2015-05-05 12:54 ` Ian Campbell
2015-05-06 7:12 ` Chao Peng
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=20150506070545.GA3458@pengc-linux.bj.intel.com \
--to=chao.p.peng@linux.intel.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=keir@xen.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=will.auld@intel.com \
--cc=xen-devel@lists.xen.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.