|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 4/9] mm: Scrub memory from idle loop
>>> On 03.04.17 at 18:50, <boris.ostrovsky@xxxxxxxxxx> wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -1043,16 +1043,44 @@ static struct page_info *merge_chunks(struct
> page_info *pg, unsigned int node,
> return pg;
> }
>
> -static void scrub_free_pages(unsigned int node)
> +static nodemask_t node_scrubbing;
> +static unsigned int node_to_scrub(bool_t get_node)
Blank line between these two please.
> +{
> + nodeid_t node = cpu_to_node(smp_processor_id()), local_node;
> +
> + if ( node == NUMA_NO_NODE )
> + node = 0;
> + local_node = node;
> +
> + /*
> + * Check local node fist and then then see if there are any memory-only
> + * nodes that may need scrubbing
> + */
> + while ( 1 )
> + {
> + if ( node_need_scrub[node] &&
> + (!node_test_and_set(node, node_scrubbing) || !get_node) )
> + return node;
> + do {
> + node = cycle_node(node, node_online_map);
> + if ( node == local_node )
> + return NUMA_NO_NODE;
> + } while ( !cpumask_empty(&node_to_cpumask(node)) );
I think this needs logic to prefer closer nodes over more distant
ones, or else the latency of coming back out of the idle loop may
grow needlessly high.
> + }
> +}
> +
> +bool_t scrub_free_pages()
Plain bool please and missing void.
> {
> struct page_info *pg;
> unsigned int i, zone;
> - int order;
> + int order, cpu = smp_processor_id();
Both unsigned int.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |