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

Re: [Xen-devel] [PATCH v4 02/21] xen: make two memory hypercalls vNUMA-aware



>>> On 23.01.15 at 17:06, <wei.liu2@xxxxxxxxxx> wrote:
> So the logic of translation now is (take into consideration the second
> point of how we should enforce exact_node flag, I think that flag should
> be preserved if it was requested at the beginning):

Yes, and the code looks right now.

Jan

> +static int translate_vnode_to_pnode(struct domain *d,
> +                                    struct xen_memory_reservation *r,
> +                                    struct memop_args *a)
> +{
> +    int rc = 0;
> +    unsigned int vnode, pnode;
> +
> +    if ( r->mem_flags & XENMEMF_vnode )
> +    {
> +        a->memflags &= ~MEMF_node(XENMEMF_get_node(r->mem_flags));
> +        a->memflags &= ~MEMF_exact_node;
> +
> +        read_lock(&d->vnuma_rwlock);
> +        if ( d->vnuma )
> +        {
> +            vnode = XENMEMF_get_node(r->mem_flags);
> +
> +            if ( vnode < d->vnuma->nr_vnodes )
> +            {
> +                pnode = d->vnuma->vnode_to_pnode[vnode];
> +
> +                if ( pnode != NUMA_NO_NODE )
> +                {
> +                    a->memflags |= MEMF_node(pnode);
> +                    if ( r->mem_flags & XENMEMF_exact_node_request )
> +                        a->memflags |= MEMF_exact_node;
> +                }
> +            }
> +            else
> +                rc = -EINVAL;
> +        }
> +        read_unlock(&d->vnuma_rwlock);
> +    }
> +
> +    return rc;
> +}
> 
>> Wei.
>> 
>> > 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®.