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

Re: [Xen-devel] [PATCH v4 16/21] libxl: build, check and pass vNUMA info to Xen for HVM guest



On Fri, 2015-01-23 at 11:13 +0000, Wei Liu wrote:
> +    if (info->num_vnuma_nodes != 0) {
> +        int i;
> +
> +        args.nr_vnuma_info = info->num_vnuma_nodes;
> +        args.vnuma_info = libxl__malloc(gc, sizeof(*args.vnuma_info) *
> +                                        args.nr_vnuma_info);
> +        for (i = 0; i < args.nr_vnuma_info; i++) {
> +            args.vnuma_info[i].vnode = i;
> +            args.vnuma_info[i].pnode = info->vnuma_nodes[i].pnode;
> +            args.vnuma_info[i].pages = info->vnuma_nodes[i].memkb >> 2;
> +        }
> +
> +        /* Consider video ram belongs to node 0 */
> +        args.vnuma_info[0].pages -= (info->video_memkb >> 2);

You need to check that the node is big enough I think?

> +            if (next >= hole_start && next < hole_end)
> +                next = hole_end;
> +            if ((next < hole_start) && (next + remaining_bytes >= 
> hole_start))
> +                count = hole_start - next;
> +
> +            GCREALLOC_ARRAY(vmemranges, nr_vmemrange+1);

Given there's only a single hole, can't you calculate the final
nr_vmemrange value up front? (i.e. it's 2, I think).

Ian.


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