WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3 of 4] Extend cpupools to support numa

To: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 4] Extend cpupools to support numa
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Wed, 8 Dec 2010 10:58:55 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 08 Dec 2010 03:04:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <d3880bd8b4674e0ec88d.1290755426@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <d3880bd8b4674e0ec88d.1290755426@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
See previous comments about the interface to libxl_get_topoplogy and
leaking the returned pointer value.

On Fri, 2010-11-26 at 07:10 +0000, Juergen Gross wrote:
> +    if (libxl_get_freecpus(&ctx, &freemap)) {
> +        fprintf(stderr, "libxl_get_freecpus failed\n");
> +        return -ERROR_FAIL;
> +    }
> +
> +    topology = libxl_get_topologyinfo(&ctx);
> +    if (topology == NULL) {
> +        fprintf(stderr, "libxl_get_topologyinfo failed\n");
> +        return -ERROR_FAIL;
> +    }
> +
> +    n = 0;
> +    for (cpu = 0; cpu < topology->nodemap.entries; cpu++) {
> +        if (libxl_cpumap_test(&freemap, cpu) &&
> +            (topology->nodemap.array[cpu] == node) &&
> +            !libxl_cpupool_cpuadd(&ctx, poolid, cpu)) {
> +                n++;
> +        }
> +    }

This sequence of actions look like they would make a useful addition to
the libxl interface as a helper function.

Not sure what it would be called, perhaps:
        libxl_cpupool_cpuadd_node(&ctx, poolid, node)
?

> +    for (p = 0; p < n_pools; p++) {
> +        if (poolinfo[p].poolid == poolid) {
> +            for (cpu = 0; cpu < topology->nodemap.entries; cpu++) {
> +                if ((topology->nodemap.array[cpu] == node) &&
> +                    libxl_cpumap_test(&poolinfo[p].cpumap, cpu) &&
> +                    !libxl_cpupool_cpuremove(&ctx, poolid, cpu)) {
> +                        n++;
> +                }
> +            }
> +        }
> +    }

also a helper function?

libxl_cpupool_cpuremove_node(&ctx, poolid, node)

Isn't there an existing function to find a poolinfo from a poolid? (if
not then should there be?)

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>