Re: [PATCH] for_each_zone / for_each_pgdat

Martin J. Bligh
2002-04-15T21:21:28Z

> 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.