Re: [PATCH] refine for_each_pgdat() [1/4] refine for_each_pgdat

From: Andrew Morton
Date: Wed Feb 22 2006 - 17:48:34 EST


KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
>
> This patch makes for_each_pgdat() use node_online_map.
>
> Now, online nodes are managed by node_online_map. But
> for_each_pgdat() uses pgdat_link to traverse all nodes(pgdat).
> This means management structure is duplicated.
>
> I think using node_online_map for for_each_pgdat() is simple and
> sane implementation rather than pgdat_link.

We have a bit of a mess here.

for_each_pgdat() iterates over online nodes.

for_each_cpu() iterates over possible CPUs.

It's confusing and asymmetric. If you have time, it would be nice to later
remove for_each_pgdat() and for_each_cpu() from the kernel altogether, use
for_each_online_cpu(), for_each_possible_cpu(), for_each_online_node(),
for_each_possible_node().
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/