All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH v3 ]libxl: allow to set more than 31 vcpus
Date: Fri, 01 Jun 2012 12:23:07 +0200	[thread overview]
Message-ID: <1338546187.31901.45.camel@Abyss> (raw)
In-Reply-To: <1338543666.17466.55.camel@zakaz.uk.xensource.com>


[-- Attachment #1.1: Type: text/plain, Size: 3207 bytes --]

On Fri, 2012-06-01 at 10:41 +0100, Ian Campbell wrote: 
> > Mmm... Maybe this is still related to the fact that on all the test
> > boxes I've used, libxl_get_max_cpus() returns something higher than the
> > actual physical CPU count of those boxes themselves, but I just created
> > an 18 VCPUs VM on my 16 PCPUs test machine... I take the above like you
> > can't, can you?
> 
> I think libxl_get_max_cpus and/or libxl_cpumap_alloc involved some
> amount of rounding up, if you tried to create a 33 vcpu guest on that
> machine (or a machine with <= 32 cpus) it may not work...
> 
It does:

    max_cpus = libxl_get_max_cpus(ctx);
    if (max_cpus == 0)
        return ERROR_FAIL;

    sz = (max_cpus + 7) / 8;

So in my case it should be 16 + 7 = 23 / 8 = 2 ... Right? Then we have:

    cpumap->map = calloc(sz, sizeof(*cpumap->map));

Which make me thinking I'm getting a 2 elements uint8_t array for
storing the cpumap (please correct me if I'm wrong, I frequently am when
it comes to math! :-P). That's way I wasn't expecting to be able to
exceed 16 VCPUs.

Anyway, I just tried 25 and 33 and 65, and creation of the domain worked
without raising any errors! Then I double-checked, and saw that, in the
'above 16' cases, Xen deliberately paused a lot of VCPUs. Also, if I log
into the guest /proc/cpuinfo reports only CPUs 0 and 32 (and 64 in the
65 VCPUs case).

To conclude, I'm not sure what's going on, but I don't think is
something we would want... :-/ 

> > Maybe it is that *_max_cpus() logic that needs some attention? :-O
> 
> max_cpus returns the max number of physical cpus, and I think it does so
> correctly (perhaps with some slop at the top end). 
>
As we also saw in another thread, it seems to return the max_cpu_id+1,
which is different from the number of physical CPUs (at least in my
case). And in fact, I'm sure it returns 64 on my box. However, that does
not appear to be the main issue here, as creation seem to succeed no
matter how much VCPUs I ask for, but then a number of them are off. :-O

If that is a known/documented behaviour, fine, I just haven't found it.
Otherwise, perhaps I can investigate a bit what's going on, if that is
considered interesting...

> In some cases we want
> to talk about virtual cpus and this change lets us size cpumap's of
> virtual cpus more appropriately (be that larger or smaller than the
> number of physical cpus).
> 
I have no argument against this. As I tried to explain, I thought

/* get max. number of cpus supported by hypervisor */
int libxl_get_max_cpus(libxl_ctx *ctx);

"max. number of cpus supported by hypervisor" to be different from the
actual number of physical processors, and I was sort-of mislead by the
machine I use to test Xen every day (where that is actually happening!).
If it is not like that, I guess I can agree with you on this change.

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/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: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2012-06-01 10:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-01  2:48 [PATCH v3 ]libxl: allow to set more than 31 vcpus Zhang, Yang Z
2012-06-01  6:35 ` Dario Faggioli
2012-06-01  7:18   ` Zhang, Yang Z
2012-06-01  8:44     ` Dario Faggioli
2012-06-01  8:58       ` Ian Campbell
2012-06-01  9:32         ` Dario Faggioli
2012-06-01  9:41           ` Ian Campbell
2012-06-01 10:23             ` Dario Faggioli [this message]
2012-06-01 10:38               ` Ian Campbell
2012-06-01 10:47                 ` Dario Faggioli
2012-06-01 10:50                   ` Ian Campbell
2012-06-01 11:04                     ` Dario Faggioli
2012-06-01 11:09                       ` Ian Campbell
2012-06-01 11:44 ` Ian Campbell
2012-06-22 12:11   ` Ian Campbell
2012-06-24 23:35     ` Zhang, Yang Z

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=1338546187.31901.45.camel@Abyss \
    --to=raistlin@linux.it \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yang.z.zhang@intel.com \
    /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.