From: Dario Faggioli <dario.faggioli@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH for-4.6 2/3] xl: fix vNUMA vcpus parsing
Date: Thu, 13 Aug 2015 11:32:35 +0200 [thread overview]
Message-ID: <1439458355.24583.69.camel@citrix.com> (raw)
In-Reply-To: <1439408161-15015-3-git-send-email-wei.liu2@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 2927 bytes --]
On Wed, 2015-08-12 at 20:36 +0100, Wei Liu wrote:
> Originally, if user didn't specify maxvcpus= in xl config file, the
> maximum size of vcpu bitmap was always equal to maximum number of pcpus.
> This might not be what user wants.
>
So, to understand, the issue here is that the bitmaps may be too bit,
and hence we're wasting memory? Or (since you're mentioning valgrind)
are (without this patch) also leaking stuff in some way?
I'm confused by he "not be what user wants" part, as, IMO, the actual
user --i.e., the person writing the config file and then issuing the `xl
ceate' command-- wouldn't notice any difference, would it? Of course,
that does not mean that we should waste memory... as I said, I'm asking
in order to understand what this patch is actually trying to fix...
About the code...
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 078acd1..0fcef98 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
>
Would it make sense to skip this (the first) step if the user actually
did specify "maxvcpus="? Or, if not, at least... ... ...
> + /* Pass one, get the total number of vcpus */
> + PARSE_VNUMA_SPEC({
> + if (!strcmp("vcpus", option)) {
> + split_string_into_string_list(value, ",", &cpu_spec_list);
> + len = libxl_string_list_length(&cpu_spec_list);
>
> - vnode_spec = xlu_cfg_get_listitem2(vnuma, i);
> - assert(vnode_spec);
> + for (j = 0; j < len; j++) {
> + parse_range(cpu_spec_list[j], &s, &e);
> + for (; s <= e; s++)
> + max_vcpus++;
> + }
> + libxl_string_list_dispose(&cpu_spec_list);
> + }
> + });
>
... ... ... Move the check for that here, i.e., avoiding doing the
second pass if there is a mismatch?
> + for (i = 0; i < num_vnuma; i++) {
> + libxl_bitmap_init(&vcpu_parsed[i]);
> + if (libxl_cpu_bitmap_alloc(ctx, &vcpu_parsed[i], max_vcpus)) {
> + fprintf(stderr, "libxl_node_bitmap_alloc failed.\n");
> exit(1);
> }
> + }
> + /* Pass two, fill in structs */
> + PARSE_VNUMA_SPEC({
> + if (!strcmp("pnode", option)) {
> + val = parse_ulong(value);
> + if (val >= nr_nodes) {
> + fprintf(stderr,
> + "xl: invalid pnode number: %lu\n", val);
> /* User has specified maxvcpus= */
> if (b_info->max_vcpus != 0 && b_info->max_vcpus != max_vcpus) {
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-08-13 9:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 19:35 [PATCH for-4.6 0/3] More vNUMA fixes Wei Liu
2015-08-12 19:35 ` [PATCH for-4.6 1/3] xl: fix vNUMA vdistance parsing Wei Liu
2015-08-13 8:35 ` Dario Faggioli
2015-08-12 19:36 ` [PATCH for-4.6 2/3] xl: fix vNUMA vcpus parsing Wei Liu
2015-08-13 9:26 ` David Vrabel
2015-08-13 9:32 ` Dario Faggioli [this message]
2015-08-13 9:47 ` Wei Liu
2015-08-13 9:42 ` Ian Campbell
2015-08-13 9:54 ` Wei Liu
2015-08-13 10:07 ` Ian Campbell
2015-08-13 10:28 ` Wei Liu
2015-08-13 10:40 ` Ian Campbell
2015-08-12 19:36 ` [PATCH for-4.6 3/3] libxc: fix vNUMA memory allocation Wei Liu
2015-08-13 8:34 ` Dario Faggioli
2015-08-13 20:23 ` Boris Ostrovsky
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=1439458355.24583.69.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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.