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,
Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org,
will.auld@intel.com, keir@xen.org, dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v7 03/14] x86: detect and initialize Intel CAT feature
Date: Wed, 20 May 2015 17:26:38 +0800 [thread overview]
Message-ID: <20150520092638.GA11040@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <555C6AB8020000780007BFE0@mail.emea.novell.com>
On Wed, May 20, 2015 at 10:06:32AM +0100, Jan Beulich wrote:
> >>> On 20.05.15 at 05:21, <chao.p.peng@linux.intel.com> wrote:
> > On Tue, May 19, 2015 at 11:22:54AM +0100, Jan Beulich wrote:
> >> >>> On 19.05.15 at 11:33, <chao.p.peng@linux.intel.com> wrote:
> >> > On Tue, May 19, 2015 at 09:42:07AM +0100, Jan Beulich wrote:
> >> >> >>> On 19.05.15 at 09:40, <chao.p.peng@linux.intel.com> wrote:
> >> >> > On Mon, May 18, 2015 at 02:33:51PM +0100, Jan Beulich wrote:
> >> >> >> >>> On 08.05.15 at 10:56, <chao.p.peng@linux.intel.com> wrote:
> >> >> >> > +static unsigned long *__read_mostly cat_socket_init_bitmap;
> >> >> >> > +static unsigned long *__read_mostly cat_socket_enable_bitmap;
> >> >> >>
> >> >> >> Didn't we agree to fold these two into one? Apart from that the
> >> >> >> _bitmap name tag doesn't seem very useful...
> >> >> >
> >> >> > Looks like this?
> >> >> >
> >> >> > static unsigned long *__read_mostly cat_socket_init,
> >> >> > *__read_mostly cat_socket_enable;
> >> >>
> >> >> Yes, except that you will want to drop one (or make clear why you
> >> >> need both).
> >> >
> >> > As said in the previous version, cat_socket_enable is the actual CAT
> >> > enabled status.
> >> >
> >> > And cat_socket_init is used for performance optimization purpose only.
> >> > It indicate if the socket has been initialized, so that initialization
> >> > happens only once for each socket, but not __cpus_in_socket__ times.
> >> >
> >> > There are three possibilities:
> >> > 1) Not initialized;
> >> > 2) Initialized, CAT disabled;
> >> > 3) Initialized, CAT enabled;
> >> >
> >> > So it's not possible to use only one bit to represent three values.
> >>
> >> Why? The two bits get set together, and get cleared together. Even
> >> if they have formally different meaning, there is - afaict - no case
> >> where their values will differ (except for the brief period between
> >> setting one and then the other).
> >
> > Do you want to try the failure initialization(both because CAT is not
> > even supported on the machine or fails to allocate cos_to_cbm) on and
> > on?
>
> I don't see any harm - all you save is a cpuid_count() invocation.
Then I will remove cat_socket_init.
>
> >> But again - only the allocation/freeing should be done in the
> >> alternative named notifications, not the actual data setup (as that
> >> iirc needs to run on the CPU).
> >
> > I know this is the general rules, but for this case, I don't think it's
> > going to work to allocate memory in CPU_UP_PREPARE while do the
> > initialization later(in CPU_STARTING).
> >
> > As said, the allocation has dependency on the result of the
> > initialization. E.g. before
> >
> > info->cos_to_cbm = xzalloc_array(struct psr_cat_cbm,
> > info->cos_max + 1UL);
> >
> > info->cos_max must have been known.
>
> Ah, yes. Otoh, considering that everywhere else we expect
> symmetry across CPUs, do you really think there are going to be
> systems with different CPUs having different cos_max values?
I agree, such systems should be rare, or even doesn't exist in the real
world. But as we are trying to support it, then I have to make it working.
Chao
next prev parent reply other threads:[~2015-05-20 9:26 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 8:56 [PATCH v7 00/14] enable Cache Allocation Technology (CAT) for VMs Chao Peng
2015-05-08 8:56 ` [PATCH v7 01/14] x86: add socket_to_cpumask Chao Peng
2015-05-18 13:21 ` Jan Beulich
2015-05-19 6:12 ` Chao Peng
2015-05-19 6:28 ` Jan Beulich
2015-05-19 6:47 ` Chao Peng
2015-05-19 6:52 ` Jan Beulich
2015-05-19 7:10 ` Chao Peng
2015-05-19 7:31 ` Jan Beulich
2015-05-19 9:51 ` Chao Peng
2015-05-19 10:18 ` Jan Beulich
2015-05-20 3:13 ` Chao Peng
2015-05-20 9:00 ` Jan Beulich
2015-05-08 8:56 ` [PATCH v7 02/14] x86: improve psr scheduling code Chao Peng
2015-05-08 10:20 ` Jan Beulich
2015-05-11 1:35 ` Chao Peng
2015-05-08 8:56 ` [PATCH v7 03/14] x86: detect and initialize Intel CAT feature Chao Peng
2015-05-18 13:33 ` Jan Beulich
2015-05-19 7:40 ` Chao Peng
2015-05-19 8:42 ` Jan Beulich
2015-05-19 8:46 ` Jan Beulich
2015-05-19 9:33 ` Chao Peng
2015-05-19 10:22 ` Jan Beulich
2015-05-20 3:21 ` Chao Peng
2015-05-20 9:06 ` Jan Beulich
2015-05-20 9:26 ` Chao Peng [this message]
2015-05-08 8:56 ` [PATCH v7 04/14] x86: maintain COS to CBM mapping for each socket Chao Peng
2015-05-18 13:35 ` Jan Beulich
2015-05-19 7:41 ` Chao Peng
2015-05-08 8:56 ` [PATCH v7 05/14] x86: add COS information for each domain Chao Peng
2015-05-08 8:56 ` [PATCH v7 06/14] x86: expose CBM length and COS number information Chao Peng
2015-05-08 8:56 ` [PATCH v7 07/14] x86: dynamically get/set CBM for a domain Chao Peng
2015-05-14 9:19 ` Dario Faggioli
2015-05-15 1:35 ` Chao Peng
2015-05-18 13:45 ` Jan Beulich
2015-05-08 8:56 ` [PATCH v7 08/14] x86: add scheduling support for Intel CAT Chao Peng
2015-05-08 8:56 ` [PATCH v7 09/14] xsm: add CAT related xsm policies Chao Peng
2015-05-08 8:56 ` [PATCH v7 10/14] tools/libxl: minor name changes for CMT commands Chao Peng
2015-05-08 8:56 ` [PATCH v7 11/14] tools/libxl: add command to show PSR hardware info Chao Peng
2015-05-08 8:56 ` [PATCH v7 12/14] tools/libxl: introduce some socket helpers Chao Peng
2015-05-08 8:56 ` [PATCH v7 13/14] tools: add tools support for Intel CAT Chao Peng
2015-05-08 13:38 ` Ian Campbell
2015-05-08 8:56 ` [PATCH v7 14/14] docs: add xl-psr.markdown Chao Peng
2015-05-08 13:39 ` Ian Campbell
2015-05-08 13:41 ` [PATCH v7 00/14] enable Cache Allocation Technology (CAT) for VMs Ian Campbell
2015-05-08 13:48 ` Jan Beulich
2015-05-08 14:11 ` Ian Campbell
2015-05-11 1:37 ` 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=20150520092638.GA11040@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=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.