[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 ]libxl: allow to set more than 31 vcpus



> -----Original Message-----
> From: Dario Faggioli [mailto:raistlin@xxxxxxxx]
> Sent: Friday, June 01, 2012 2:36 PM
> To: Zhang, Yang Z
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx; Ian Campbell
> Subject: Re: [Xen-devel] [PATCH v3 ]libxl: allow to set more than 31 vcpus
> 
> On Fri, 2012-06-01 at 02:48 +0000, Zhang, Yang Z wrote:
> > Change from v2:
> > Add function libxl_cpumap_to_hex_string to covert cpumap to hex string.
> > According to Ian's comments, modified some codes to make the logic more
> reasonable.
> >
> > In current implementation, it uses integer to record current avail cpus and
> this only allows user to specify 31 vcpus.
> > In following patch, it uses cpumap instead integer which make more sense
> than before. Also there is no limit to the max vcpus.
> >
> This part I understand, and looks reasonable.
> 
> I also see this is the whole point of your other patch, however ...
> 
> > diff -r 3b0eed731020 tools/libxl/xl_cmdimpl.c
> > --- a/tools/libxl/xl_cmdimpl.c  Fri Jun 01 09:27:17 2012 +0800
> > +++ b/tools/libxl/xl_cmdimpl.c  Fri Jun 01 10:34:13 2012 +0800
> > @@ -650,7 +650,14 @@ static void parse_config_data(const char
> >
> >      if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
> >          b_info->max_vcpus = l;
> > -        b_info->cur_vcpus = (1 << l) - 1;
> > +
> > +        if (libxl_cpumap_alloc(ctx, &b_info->avail_vcpus, l)) {
> > +            fprintf(stderr, "Unable to allocate cpumap\n");
> > +            exit(1);
> > +        }
> >
> ... Do you mind explaining me what would have happened here without your
> previous patch, i.e., by just using the existing libxl_cpumap_alloc ?
>
> I might be wrong, but I was wondering whether it is worth changing the
> interface like that for just this single case which saves, what, 1 to 3
> bytes per domain?
> 

It's ok to use existing libxl_cpumap_alloc(). But in my case, there is no need 
to use the existing interface.
And, in future, there are some cases may not need to allocate max size cpumap 
too. So it's better to extend the current interface.

best regards
yang
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.