All of lore.kernel.org
 help / color / mirror / Atom feed
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 1/6] x86: detect and initialize Intel CAT feature
Date: Tue, 17 Mar 2015 16:48:30 +0800	[thread overview]
Message-ID: <20150317084830.GB5371@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <5506ECEA020000780006A4CD@mail.emea.novell.com>

On Mon, Mar 16, 2015 at 01:47:06PM +0000, Jan Beulich wrote:
> >>> On 13.03.15 at 11:13, <chao.p.peng@linux.intel.com> wrote:
> > @@ -1112,6 +1117,12 @@ The following resources are available:
> >    total/local memory bandwidth. Follow the same options with Cache Monitoring
> >    Technology.
> >  
> > +* Cache Alllocation Technology (Broadwell and later).  Information regarding
> > +  the cache allocation.
> > +  * `cat` instructs Xen to enable/disable Cache Allocation Technology.
> > +  * `socket_num` indicates socket number. Detecte automatically at boot time
> > +    if not specified(0). Useful for CPU hot-plug case.
> 
> While saying something, at least for me what is being said doesn't at
> all make clear what "socket number" here is: The number of a specific
> socket? The number of sockets? Yet something else? Without knowing
> what it means by _just_ reading this description, people won't know
> what to use the command line option for.

I agree, the name is a little confusing. Or perhaps: max_socket? E.g.

`max_socket` indicates the maximum number of available sockets for CAT
feature detection. All the sockets up to max_socket will be checked for
CAT feature. The value is normally detected at boot time automatically
if not specified(0). While the value may need to be specified manually
for CPU hot-plug scenario in which case the maximum socket number detected
at boot time may be not correct.

> 
> > -static void __init init_psr_cmt(unsigned int rmid_max)
> > +static void __init psr_cmt_init(unsigned int rmid_max)
> 
> Is this renaming really an integral part of this patch?

OK, I will move it to separate one or just keep it unchanged.

> 
> > +        on_selected_cpus(cpumask_of(cpu), do_cat_cpu_init, info, 0);
> 
> Hmm, using an IPI here seems odd. Is there a reason to can't hook
> this onto CPU_STARTING instead of CPU_ONLINE?

Looks like CPU_STARTING is what I need, IPI then is unnecessary.

> 
> > +static unsigned int get_max_socket(void)
> > +{
> > +    unsigned int cpu, max_apicid = boot_cpu_physical_apicid;
> > +
> > +    for_each_present_cpu(cpu)
> > +        if (max_apicid < x86_cpu_to_apicid[cpu])
> 
> Coding style.
> 
> > +            max_apicid = x86_cpu_to_apicid[cpu];
> > +
> > +    return apicid_to_socket(max_apicid);
> 
> Since when is the socket with the highest numbered APIC ID
> the highest numbered socket? I think the whole function needs
> to act on socket numbers only.

Then perhaps looping cpus and checking against cpu_to_socket(cpu)
directly make sense.

Thanks Jan.
Chao

  reply	other threads:[~2015-03-17  8:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 10:13 [PATCH 0/6] enable Cache Allocation Technology (CAT) for VMs Chao Peng
2015-03-13 10:13 ` [PATCH 1/6] x86: detect and initialize Intel CAT feature Chao Peng
2015-03-13 13:40   ` Konrad Rzeszutek Wilk
2015-03-13 13:43     ` Konrad Rzeszutek Wilk
2015-03-17  8:11     ` Chao Peng
2015-03-17 13:00       ` Konrad Rzeszutek Wilk
2015-03-18  8:31         ` Chao Peng
2015-03-16 13:47   ` Jan Beulich
2015-03-17  8:48     ` Chao Peng [this message]
2015-03-17  9:01       ` Jan Beulich
2015-03-13 10:13 ` [PATCH 2/6] x86: add support for COS/CBM manangement Chao Peng
2015-03-13 13:53   ` Konrad Rzeszutek Wilk
2015-03-17  8:57     ` Chao Peng
2015-03-16 17:10   ` Jan Beulich
2015-03-17  9:11     ` Chao Peng
2015-03-17  9:25       ` Jan Beulich
2015-03-17 10:06         ` Chao Peng
2015-03-13 10:13 ` [PATCH 3/6] X86: improve psr scheduling code Chao Peng
2015-03-16 16:53   ` Jan Beulich
2015-03-17  9:12     ` Chao Peng
2015-03-13 10:13 ` [PATCH 4/6] x86: add scheduling support for Intel CAT Chao Peng
2015-03-17  9:19   ` Jan Beulich
2015-03-17  9:33     ` Chao Peng
2015-03-13 10:13 ` [PATCH 5/6] xsm: add CAT related xsm policies Chao Peng
2015-03-13 16:45   ` Daniel De Graaf
2015-03-13 10:13 ` [PATCH 6/6] tools: add tools support for Intel CAT 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=20150317084830.GB5371@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.