Russell King wrote: > On Mon, Oct 28, 2002 at 11:47:00AM -0800, Matthew Dobson wrote: >>>It would be better if it remained in mmzone.h for non-arm, and the >>>memory.h files for arm. I really never understood why numnodes.h was >>>created when mmzone.h has works adequately well since 2.3. >> >>As mentioned in the original post, I was trying >>to kill a bunch of (seemingly) unnecessary .h files (the numnodes.h's >>specifically), and remove the MAX_[NUM|NR_]NODES duality. If that can't >>be accomplished, then all this would do is move the confusion around, >>and I don't want that... > > I'm in agreement with you here. I knew we must have some motivation in common! ;) >>If you feel param.h is the wrong place, I originally had the #define's >>in asm/topology.h. > > This seems like a good solution - linux/mmzone.h already includes this > file, so it wouldn't be adding all that much to the #include hell. > Also, asm-generic/topology.h contains stuff to do with numa/discontig > already, so it seems perfect. Ok... I've revised the patch to put the #define's in topology.h. Please have a look and make sure I still haven't butchered things for arm. I think that is a particularly reasonable place to define MAX_NR_NODES and other topology things! :) We'll see if this piques anyone's interest. >>max_numnodes_fix.patch Collapse the use of MAX_NUMNODES throughout the kernel into the already existing, far less used, yet far more appropriately named MAX_NR_NODES. [mcd@arrakis src]$ diffstat ~/patches/max_numnodes_fix-2.5.44.patch arch/alpha/mm/numa.c | 6 +++--- arch/arm/mm/discontig.c | 6 +++--- arch/arm/mm/init.c | 12 +++--------- arch/i386/kernel/numaq.c | 10 ++++++---- arch/i386/mm/discontig.c | 11 +++++------ arch/ppc64/mm/init.c | 2 +- arch/ppc64/mm/numa.c | 10 +++++----- include/asm-alpha/numnodes.h | 12 ------------ include/asm-alpha/topology.h | 10 ++++++++++ include/asm-arm/arch-clps711x/memory.h | 2 -- include/asm-arm/arch-sa1100/memory.h | 2 -- include/asm-arm/memory.h | 5 +++-- include/asm-arm/numnodes.h | 17 ----------------- include/asm-arm/topology.h | 4 ++++ include/asm-generic/topology.h | 4 ++++ include/asm-i386/numaq.h | 5 ++--- include/asm-i386/numnodes.h | 12 ------------ include/asm-i386/topology.h | 4 ++++ include/asm-ppc64/numnodes.h | 6 ------ include/asm-ppc64/topology.h | 6 ++++++ include/linux/mmzone.h | 19 +++++++------------ 21 files changed, 66 insertions(+), 99 deletions(-) Kills 33 lines of code, and also kills 4 files. With (apparently) no change in functionality and possibly even a positive change in readability. Cheers! -Matt