linux-mips
[Top] [All Lists]

Re: [PATCH] Cleanup bootmem_init()

To: vagabon.xyz@gmail.com
Subject: Re: [PATCH] Cleanup bootmem_init()
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sun, 06 Aug 2006 00:30:28 +0900 (JST)
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <44D34C84.9090902@innova-card.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <44D34C84.9090902@innova-card.com>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 04 Aug 2006 15:32:52 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> 
wrote:
> This function although doing simple things is hard to follow. It's
> mainly due to:
> 
>     - a lot of #ifdef
>     - bad local names
>     - redundant tests
> 
> So this patch try to address these issues. It also do not use
> max_pfn global which is marked as an unused exported symbol.

Looks good for me, except this:

> -     if (max_low_pfn > MAXMEM_PFN) {
> -             max_low_pfn = MAXMEM_PFN;
> -#ifndef CONFIG_HIGHMEM
> -             /* Maximum memory usable is what is directly addressable */
> -             printk(KERN_WARNING "Warning only %ldMB will be used.\n",
> -                    MAXMEM >> 20);
> -             printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
> +     if (highest > PFN_DOWN(HIGHMEM_START)) {
> +#ifdef CONFIG_HIGHMEM
> +             highstart_pfn = PFN_DOWN(HIGHMEM_START);
> +             highend_pfn = highest;
>  #endif
> +             highest = PFN_DOWN(HIGHMEM_START);
>       }

You drop two warnings here.  I'm afraid this leads so many "I have 1GB
memory but can not use all of them. Why?" questions.

BTW, "Use a HIGHMEM enabled kernel" might not be good.  I suppose Ralf
wants something like this :-)

#if defined(CPU_SUPPORTS_64BIT_KERNEL) && defined(SYS_SUPPORTS_64BIT_KERNEL)
                printk(KERN_WARNING "Use a 64-bit kernel.\n");
#elif defined(CPU_SUPPORTS_HIGHMEM) && defined(SYS_SUPPORTS_HIGHMEM)
                printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
#else
                /* put a good excuse here... */
#endif

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>