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

Re: [Xen-devel] [PATCH 3/3] page-alloc: Clamp get_free_buddy() to online nodes



>>> On 25.06.19 at 16:43, <andrew.cooper3@xxxxxxxxxx> wrote:
> d->node_affinity defaults to NODE_MASK_ALL which has bits set outside of
> node_online_map.  This in turn causes the loop in get_free_buddy() to waste
> effort iterating over offline nodes.
> 
> Always clamp d->node_affinity to node_online_map when in use.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
despite ...

> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -811,11 +811,15 @@ static struct page_info *get_free_buddy(unsigned int 
> zone_lo,
>                                          const struct domain *d)
>  {
>      nodeid_t first, node = MEMF_get_node(memflags), req_node = node;
> -    nodemask_t nodemask = d ? d->node_affinity : node_online_map;
> +    nodemask_t nodemask;
>      unsigned int j, zone, nodemask_retry = 0;
>      struct page_info *pg;
>      bool use_unscrubbed = (memflags & MEMF_no_scrub);
>  
> +    /* Clamp nodemask to node_online_map and optionally d->node_affinity. */
> +    nodes_and(&nodemask, &node_online_map,
> +              d ? &d->node_affinity : &node_online_map);

... finding it a little odd (inefficient) to AND node_online_map with itself.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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