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

Re: [Xen-devel] [PATCH v4 14/15] xl: enable for specifying node-affinity in the config file



On mer, 2013-11-27 at 15:53 +0000, Ian Campbell wrote:
> On Fri, 2013-11-22 at 19:58 +0100, Dario Faggioli wrote:
> > +static int *parse_config_cpumap_list(XLU_ConfigList *cpus,
> > +                                     libxl_bitmap *cpumap,
> > +                                     int max_vcpus)
> 
> I assume this is pure motion/refactoring? Or do I need to read it?
> 
It indeed it motion/refactoring, and so it is in v5.

> > +{
> > +    int i, n_cpus = 0;
> > +    int *to_pcpu;
> > +    const char *buf;
> > +
> > +    if (libxl_cpu_bitmap_alloc(ctx, cpumap, 0)) {
> > +        fprintf(stderr, "Unable to allocate cpumap\n");
> > +        exit(1);
> > +    }
> > +
> > +    /* Prepare the array for single vcpu to pcpu mappings */
> > +    to_pcpu = xmalloc(sizeof(int) * max_vcpus);
> > +    memset(to_pcpu, -1, sizeof(int) * max_vcpus);
> > +
> > +    /*
> > +     * Idea here is to let libxl think all the domain's vcpus
> > +     * have cpu affinity with all the pcpus on the list. Doing
> > +     * that ensures memory is allocated on the proper NUMA nodes.
> > +     * It is then us, here in xl, that matches each single vcpu
> > +     * to its pcpu (and that's why we need to stash such info in
> > +     * the to_pcpu array now) after the domain has been created.
> > +     * This way, we avoid having to pass to libxl some big array
> > +     * hosting the single mappings.
> > +     */
> > +    libxl_bitmap_set_none(cpumap);
> > +    while ((buf = xlu_cfg_get_listitem(cpus, n_cpus)) != NULL) {
> > +        i = atoi(buf);
> > +        if (!libxl_bitmap_cpu_valid(cpumap, i)) {
> > +            fprintf(stderr, "cpu %d illegal\n", i);
> > +            exit(1);
> > +        }
> > +        libxl_bitmap_set(cpumap, i);
> > +        if (n_cpus < max_vcpus)
> > +            to_pcpu[n_cpus] = i;
> > +        n_cpus++;
> > +    }
> > +
> > +    return to_pcpu;
> > +}
> > +
> > +static void parse_config_cpumap_string(const char *buf, libxl_bitmap 
> > *cpumap)
> 
> Likewise this is also motion/refactoring, correct?
> 
Same here.

Thanks and 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: signature.asc
Description: This is a digitally signed message part

_______________________________________________
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®.