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

Re: [Xen-devel] [RFC PATCH V3 10/16] netback: rework of per-cpu scratch space.



Le 30 janvier 2012 15:45, Wei Liu <wei.liu2@xxxxxxxxxx> a écrit :
> If we allocate large arrays in per-cpu section, multi-page ring
> feature is likely to blow up the per-cpu section. So avoid allocating
> large arrays, instead we only store pointers to scratch spaces in
> per-cpu section.
>
> CPU hotplug event is also taken care of.
>

>  }
>
> +static int __create_percpu_scratch_space(unsigned int cpu)
> +{
> +       per_cpu(tx_copy_ops, cpu) =
> +               vzalloc(sizeof(struct gnttab_copy) * MAX_PENDING_REQS);
> +
> +       per_cpu(grant_copy_op, cpu) =
> +               vzalloc(sizeof(struct gnttab_copy)
> +                       * 2 * XEN_NETIF_RX_RING_SIZE);
> +
> +       per_cpu(meta, cpu) = vzalloc(sizeof(struct xenvif_rx_meta)
> +                                    * 2 * XEN_NETIF_RX_RING_SIZE);
> +
> +       if (!per_cpu(tx_copy_ops, cpu) ||
> +           !per_cpu(grant_copy_op, cpu) ||
> +           !per_cpu(meta, cpu))
> +               return -ENOMEM;
> +
> +       return 0;
> +}
> +

Problem is you lost NUMA awareness here.

Please check vzalloc_node()

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.