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

Re: [Xen-devel] [PATCH v3 12/19] hvmloader: retrieve vNUMA information from hypervisor



>>> On 13.01.15 at 13:11, <wei.liu2@xxxxxxxxxx> wrote:
> +void init_vnuma_info(void)
> +{
> +    int rc, retry = 0;
> +    struct xen_vnuma_topology_info vnuma_topo;
> +
> +    vcpu_to_vnode = scratch_alloc(sizeof(uint32_t) * hvm_info->nr_vcpus, 0);

sizeof(*vcpu_to_vnode) please.

> +    rc = -EAGAIN;
> +    while ( rc == -EAGAIN && retry < 10 )

What's the justification for 10 here? A sane tool stack shouldn't alter
the values while starting the domain.

> +    {
> +        vnuma_topo.domid = DOMID_SELF;
> +        vnuma_topo.pad = 0;
> +        vnuma_topo.nr_vcpus = 0;
> +        vnuma_topo.nr_vnodes = 0;
> +        vnuma_topo.nr_vmemranges = 0;
> +
> +        set_xen_guest_handle(vnuma_topo.vdistance.h, NULL);
> +        set_xen_guest_handle(vnuma_topo.vcpu_to_vnode.h, NULL);
> +        set_xen_guest_handle(vnuma_topo.vmemrange.h, NULL);
> +
> +        rc = hypercall_memory_op(XENMEM_get_vnumainfo, &vnuma_topo);
> +
> +        if ( rc == -EOPNOTSUPP )
> +            return;
> +
> +        if ( rc != -ENOBUFS )
> +            break;
> +
> +        ASSERT(vnuma_topo.nr_vcpus == hvm_info->nr_vcpus);

I also wonder whether we shouldn't make the hypervisor return
back the (modified) values in the -EAGAIN error case, so that you
could move above first half of the loop body out of the loop.

Jan


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