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

Re: [Xen-devel] [PATCH v9 9/9] libxl: automatic NUMA placement affects soft affinity



BTW, I've got a question about libxl cleanup/garbage collection, etc.

So, in the code below:

On mer, 2014-06-18 at 16:28 +0200, Dario Faggioli wrote:

> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index 4a52da1..58f46e3 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -248,18 +248,44 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
>       * some weird error manifests) the subsequent call to
>       * libxl_domain_set_nodeaffinity() will do the actual placement,
>       * whatever that turns out to be.
>
>      if (libxl_defbool_val(info->numa_placement)) {
> +        libxl_bitmap cpumap_soft;
> +
> +        /* We require both hard and soft affinity not to be set */
>          if (!libxl_bitmap_is_full(&info->cpumap) ||
> -            info->num_vcpu_hard_affinity) {
> +            info->num_vcpu_hard_affinity || info->num_vcpu_soft_affinity) {
>              LOG(ERROR, "Can run NUMA placement only if no vcpu "
> -                       "affinity is specified");
> +                       "(hard or soft) affinity is specified");
>              return ERROR_INVAL;
>          }
>  
> -        rc = numa_place_domain(gc, domid, info);
> +        rc = libxl_cpu_bitmap_alloc(ctx, &cpumap_soft, 0);
>          if (rc)
>              return rc;
> +
> +        rc = numa_place_domain(gc, domid, info);
> +        if (rc) {
> +            libxl_bitmap_dispose(&cpumap_soft);
> +            return rc;
> +        }
> +
>
Do I need this call to libxl_bitmap_dispose(), to avoid leaking what
libxl_cpu_bitmap_alloc() did upon return, or does libxl cleans this up
for me? :-)

As you can see, I'm talking about the case where I'm inside libxl (i.e.,
within libxl__build_pre() )

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