From: Joao Martins <joao.m.martins@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH RFC 7/8] libxl: introduce topology fields
Date: Wed, 2 Mar 2016 19:16:43 +0000 [thread overview]
Message-ID: <56D73C1B.4060401@oracle.com> (raw)
In-Reply-To: <20160225162909.GJ5694@citrix.com>
On 02/25/2016 04:29 PM, Wei Liu wrote:
> On Mon, Feb 22, 2016 at 09:02:13PM +0000, Joao Martins wrote:
>> Currently there is "smt" option that changes from a flat core topology
>> to a core+thread topology. This patch adds more expressive options for
>> describing the topology as seen by the guest i.e. sockets, cores and
>> threads to adjust cpu topology as seen by the guest.
>>
>> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
>> ---
>> CC: Ian Jackson <ian.jackson@eu.citrix.com>
>> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> CC: Ian Campbell <ian.campbell@citrix.com>
>> CC: Wei Liu <wei.liu2@citrix.com>
>> ---
>> tools/libxl/libxl_dom.c | 18 ++++++++++++------
>> tools/libxl/libxl_types.idl | 4 ++++
>> 2 files changed, 16 insertions(+), 6 deletions(-)
>>
>> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
>> index ff9356d..1e6d9ab 100644
>> --- a/tools/libxl/libxl_dom.c
>> +++ b/tools/libxl/libxl_dom.c
>> @@ -507,14 +507,20 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
>> }
>>
>> libxl_cpuid_apply_policy(ctx, domid);
>> - if (info->type == LIBXL_DOMAIN_TYPE_HVM
>> - && libxl_defbool_val(info->smt)) {
>> + if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
>>
>> - uint32_t threads = 0;
>> + uint32_t threads = 0, cores = 0;
>> +
>> + if (libxl_defbool_val(info->smt)
>> + && !libxl__count_threads_per_core(gc, &threads))
>> + cores = info->max_vcpus / threads;
>> + else if (info->topology.cores) {
>> + cores = info->topology.cores;
>> + threads = info->topology.threads;
>> + }
>>
>> - if (!libxl__count_threads_per_core(gc, &threads))
>> - libxl__cpuid_set_topology(ctx, domid,
>> - info->max_vcpus / threads, threads);
>> + if (cores && threads)
>> + libxl__cpuid_set_topology(ctx, domid, cores, threads);
>> }
>>
>> if (info->cpuid != NULL)
>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>> index fa4725a..caba626 100644
>> --- a/tools/libxl/libxl_types.idl
>> +++ b/tools/libxl/libxl_types.idl
>> @@ -422,6 +422,10 @@ libxl_domain_build_info = Struct("domain_build_info",[
>> ("vcpu_hard_affinity", Array(libxl_bitmap, "num_vcpu_hard_affinity")),
>> ("vcpu_soft_affinity", Array(libxl_bitmap, "num_vcpu_soft_affinity")),
>> ("smt", libxl_defbool),
>> + ("topology", Struct(None, [("sockets", integer),
>> + ("cores", integer),
>> + ("threads", integer),
>> + ])),
>
> Maybe having topology is a good enough sophisticated configuration
> interface? (See my previous email)
Yeah. That's what I think too, though I proposed both to see what you folks
would prefer. For other potentially users of libxl (libvirt) the topology
field(s) is also a better fit. BTW, the reason for the smt parameter was mostly
for the default case, where it's a single flat topology.
>> ("numa_placement", libxl_defbool),
>> ("tsc_mode", libxl_tsc_mode),
>> ("max_memkb", MemKB),
>> --
>> 2.1.4
>>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-02 19:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 21:02 [PATCH RFC 0/8] x86/hvm, libxl: HVM SMT topology support Joao Martins
2016-02-22 21:02 ` [PATCH RFC 1/8] x86/hvm: set initial apicid to vcpu_id Joao Martins
2016-02-25 17:03 ` Jan Beulich
2016-03-02 18:49 ` Joao Martins
2016-02-22 21:02 ` [PATCH RFC 2/8] libxl: remove whitespace on libxl_types.idl Joao Martins
2016-02-25 16:28 ` Wei Liu
2016-03-02 19:14 ` Joao Martins
2016-02-22 21:02 ` [PATCH RFC 3/8] libxl: cpuid: add cache core count support Joao Martins
2016-02-22 21:02 ` [PATCH RFC 4/8] libxl: cpuid: add guest topology support Joao Martins
2016-02-25 16:29 ` Wei Liu
2016-03-02 19:14 ` Joao Martins
2016-02-22 21:02 ` [PATCH RFC 5/8] libxl: introduce smt field Joao Martins
2016-02-25 16:29 ` Wei Liu
2016-02-22 21:02 ` [PATCH RFC 6/8] xl: introduce smt option Joao Martins
2016-02-22 21:02 ` [PATCH RFC 7/8] libxl: introduce topology fields Joao Martins
2016-02-25 16:29 ` Wei Liu
2016-03-02 19:16 ` Joao Martins [this message]
2016-02-22 21:02 ` [PATCH RFC 8/8] xl: introduce topology options Joao Martins
2016-02-25 17:21 ` [PATCH RFC 0/8] x86/hvm, libxl: HVM SMT topology support Andrew Cooper
2016-02-26 15:03 ` Dario Faggioli
2016-02-26 15:27 ` Konrad Rzeszutek Wilk
2016-02-26 15:42 ` Dario Faggioli
2016-02-26 15:48 ` Andrew Cooper
2016-03-02 19:18 ` Joao Martins
2016-03-02 20:03 ` Andrew Cooper
2016-03-03 9:52 ` Joao Martins
2016-03-03 10:24 ` Andrew Cooper
2016-03-03 12:23 ` Joao Martins
2016-03-03 12:48 ` Andrew Cooper
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=56D73C1B.4060401@oracle.com \
--to=joao.m.martins@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.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 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).