[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161128092800.GC14835@dhcp22.suse.cz>
Date: Mon, 28 Nov 2016 10:28:01 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org, rt@...utronix.de, tglx@...utronix.de,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Mel Gorman <mgorman@...hsingularity.net>,
Johannes Weiner <hannes@...xchg.org>, linux-mm@...ck.org
Subject: Re: [PATCH 08/22] mm/vmstat: Avoid on each online CPU loops
On Sun 27-11-16 00:13:36, Sebastian Andrzej Siewior wrote:
[...]
> static void __init init_cpu_node_state(void)
> {
> - int cpu;
> + int node;
>
> - for_each_online_cpu(cpu)
> - node_set_state(cpu_to_node(cpu), N_CPU);
> + for_each_online_node(node)
> + node_set_state(node, N_CPU);
Is this really correct? The point of the original code was to mark only
those nodes which have at least one CPU. Or am I missing something?
> }
>
> static void vmstat_cpu_dead(int node)
> {
> - int cpu;
> + const struct cpumask *node_cpus;
>
> - for_each_online_cpu(cpu)
> - if (cpu_to_node(cpu) == node)
> - return;
> + node_cpus = cpumask_of_node(node);
> + if (cpumask_weight(node_cpus) > 0)
> + return;
This looks OK
>
> node_clear_state(node, N_CPU);
> }
> --
> 2.10.2
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists