Re: 2.6.8-rc1-mm1

From: Andrew Morton (akpm_at_osdl.org)
Date: 07/14/04

  • Next message: Keith Owens: "[RFC] Standard filesystem types for crash dumping"
    Date:	Wed, 14 Jul 2004 00:29:12 -0700
    To: linux-kernel@vger.kernel.org
    
    

    Andrew Morton <akpm@osdl.org> wrote:
    >
    >
    > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.8-rc1/2.6.8-rc1-mm1/
    >

    This kernel runs like a dessicated slug if you have more than 2G of memory
    due to a 32-bit overflow.

    Dentry cache hash table entries: 1 (order: -10, 4 bytes)
    Inode-cache hash table entries: 1 (order: -10, 4 bytes)

    The dcache is a singly-linked list. Here's a (lame) fix:

    --- 25/mm/page_alloc.c~making-i-dhash_entries-cmdline-work-as-it-use-to-fix 2004-07-14 00:11:26.437028752 -0700
    +++ 25-akpm/mm/page_alloc.c 2004-07-14 00:24:56.461886256 -0700
    @@ -2004,7 +2004,8 @@ void *__init alloc_large_system_hash(con
                                          unsigned int *_hash_shift,
                                          unsigned int *_hash_mask)
     {
    - unsigned long max, log2qty, size;
    + unsigned long long max;
    + unsigned long log2qty, size;
             void *table;
     
             /* allow the kernel cmdline to have a say */
    @@ -2025,18 +2026,19 @@ void *__init alloc_large_system_hash(con
             numentries = 1UL << (long_log2(numentries) + 1);
     
             /* limit allocation size to 1/16 total memory */
    - max = ((nr_all_pages << PAGE_SHIFT)/16) / bucketsize;
    + max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4;
    + do_div(max, bucketsize);
     
             if (numentries > max)
                     numentries = max;
     
             log2qty = long_log2(numentries);
     
    + size = bucketsize << log2qty;
             do {
    - size = bucketsize << log2qty;
    -
    - table = (void *) alloc_bootmem(size);
    -
    + table = alloc_bootmem(size);
    + if (!table)
    + size /= 2;
             } while (!table && size > PAGE_SIZE);
     
             if (!table)
    _

    btw, David, I'm wondering about this loop:

            do {
                    size = bucketsize << log2qty;

                    table = (void *) alloc_bootmem(size);

            } while (!table && size > PAGE_SIZE);

    Is this a busy-wait-until-someone-plugs-in-more-ram-chips thing? ;)

    I assume you meant something like the above?

    btw, that (void *) cast was superfluous...
    -
    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: Keith Owens: "[RFC] Standard filesystem types for crash dumping"

    Relevant Pages

    • Re: 2.4.23aa2 (bugfixes and important VM improvements for the high end)
      ... > triggering the zone-normal shortage in 32G, ... Also bear in mind that as memory gets tight, ... Without shared pagetables, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: log-buf-len dynamic
      ... Wake up, dude. ... disk and memory. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: swsusp update: supports discontingmem/highmem
      ... driver is responsible for the memory should handle any required state ... Can't you back out nicely if you don't have enough memory for the image? ... Nigel Cunningham ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] fix __div64_32 to do division properly
      ... So with the overflow case fixed, and with a 32/32 initial reduction of the ... Remember: be _careful_ with math. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: lost memory on a 4GB amd64
      ... JM>> reproduce the crash in the simplest possible way, ... JM> AGP aperature settings in your original post ... AGP and PCI I mentioned only as "the bad guys stealing the memory" ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)