Re: [PATCH] for_each_zone / for_each_pgdat

Martin J. Bligh (Martin.Bligh@us.ibm.com)
Mon, 15 Apr 2002 15:19:53 -0700


> Because code that doesn't care about pgdats shouldn't have to
> learn about them, IMHO. I used to have the doubly nested for
> loop in -rmap, but William Irwin came up with a way to make
> it a singly nested loop for code that only cares about zones.

Can't you just have the simple single and double loops in mmzone.h,
seperated by a #ifdef CONFIG_DISCONTIGMEM?

I like the general abstraction idea of where you're going though.
Is there a for_each_node already? Can't see one:

#define for_each_node(nid) \
for (nid = 0; nid < numnodes; nid++)

would allow us to change the assumption that nodes are numbered
contiguously, starting from 0, more easily later on ... ?

M.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/