Re: 2.6.12-rc5-mm1 - missing #define SECTIONS_SHIFT in sparsemem

Valdis.Kletnieks_at_vt.edu
Date: 05/30/05

  • Next message: Andi Kleen: "Re: spinaphore conceptual draft"
    To: Andy Whitcroft <apw@shadowen.org>
    Date:	Mon, 30 May 2005 12:31:08 -0400
    
    
    

    On Mon, 30 May 2005 00:27:19 BST, Andy Whitcroft said:
    > Valdis.Kletnieks@vt.edu wrote:
    > > sparsemem-memory-model.patch references SECTIONS_SHIFT without defining it.
    > >
    > > Caught this while compiling with -Wundef, causes lots of warnings
    > > when it gets used in include/linux/mm.h. The appended patch Works For Me,
    > > although I wonder if the *real* problem isn't a missing '#ifdef CONFIG_SPARSEMEM'
    > > around the code that uses it in mm.h.
    > >
    > > Signed-Off-By: valdis.kletnieks@vt.edu
    > >
    > > --- linux-2.6.12-rc5-mm1/include/linux/mmzone.h.ifdef 2005-05-27 15:1
    2:26.000000000 -0400
    > > +++ linux-2.6.12-rc5-mm1/include/linux/mmzone.h 2005-05-27 16:26:40.000
    000000 -0400
    > > @@ -568,6 +568,7 @@ static inline int pfn_valid(unsigned lon
    > > void sparse_init(void);
    > > #else
    > > #define sparse_init() do {} while (0)
    > > +#define SECTIONS_SHIFT 0
    > > #endif /* CONFIG_SPARSEMEM */
    > >
    > > #ifdef CONFIG_NODES_SPAN_OTHER_NODES
    >
    > Odd. I guess there must be a reference from an unused function to this
    > define when SPARSEMEM is off. Can you send me your .config please and
    > I'll have a look.

    The warning comes out of *every* kernel module that #includes kernel/mm.h
    and reaches line 424:

     #if SECTIONS_SHIFT+NODES_SHIFT+ZONES_SHIFT <= FLAGS_RESERVED
     #define NODES_WIDTH NODES_SHIFT
     #else
     #define NODES_WIDTH 0
     #endif

    That's not wrapped in a #ifdef CONFIG_DISCONTIGMEM or SPARSEMEN or HIGHMEM or
    any of the other obvious candidates. You only see the warning if you add
    -Wundef to your CFLAGS.

    I'll send the .config privately in a separate message. Pretty standard stock
    defaults for a laptop with only 256M of memory. The quick quick
    synopsis for the rest of you:

    [/usr/src/linux-2.6.12-rc5-mm1]2 grep MEM .config
    CONFIG_SHMEM=y
    # CONFIG_TINY_SHMEM is not set
    CONFIG_NOHIGHMEM=y
    # CONFIG_HIGHMEM4G is not set
    # CONFIG_HIGHMEM64G is not set
    CONFIG_SELECT_MEMORY_MODEL=y
    CONFIG_FLATMEM_MANUAL=y
    # CONFIG_DISCONTIGMEM_MANUAL is not set
    # CONFIG_SPARSEMEM_MANUAL is not set
    CONFIG_FLATMEM=y
    CONFIG_FLAT_NODE_MEM_MAP=y
    # CONFIG_BLK_DEV_UMEM is not set
    CONFIG_SND_DEBUG_MEMORY=y

    
    

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



  • Next message: Andi Kleen: "Re: spinaphore conceptual draft"

    Relevant Pages

    • Re: Possible dcache BUG
      ... During the compile, the above line output this warning: ... Copyright 2004 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • PROBLEM: make menuconfig command with kernel 2.6.4
      ... Is this a problem of my system or a kernel/compiler bug?! ... Here the output of my bash: ... scripts/basic/fixdep.c:193: warning: unused variable `s' ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: + shut-up-warnings-in-ipc-shmc.patch added to -mm tree
      ... > warning. ... I'm with Matt on the typechecking here, and at first liked his proposal; ... they're turning out to be real pigs instead. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: question about module and undeinfed symbols.
      ... I think the problem is isolated, I notices that System.map doesnt ... A warning appear during kernel compilation, ... parameter names in function declaration ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Initramfs and TMPFS!
      ... init/main.c:663: warning: implicit declaration of function `get_fs' ... init/main.c:664: error: (Each undeclared identifier is reported only once ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)