linux-mips
[Top] [All Lists]

Re: [PATCH] do not count pages in holes with sparsemem

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH] do not count pages in holes with sparsemem
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Thu, 06 Jul 2006 15:12:11 +0200
Cc: vagabon.xyz@gmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=CLDP9vO0jhrpmySENUWO5UK5vUuT/MlvQRje0LeI5IgzYGvK5Qeiv8KuLyFhgfNe1S6CKYM95N/YqTeop2ww5V+Wr4+XKdjwDUJ+UcsN86SBtHAtYHaSPehBFr4Ng1C0EFYq4aRtuDWGkFaiyb7V2lkZlWSKyBRM8U2gAxTRz5c=
In-reply-to: <20060705.231737.59032119.anemo@mba.ocn.ne.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060705.221354.74751389.anemo@mba.ocn.ne.jp> <44ABC59C.6070607@innova-card.com> <20060705.231737.59032119.anemo@mba.ocn.ne.jp>
Reply-to: Franck <vagabon.xyz@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 1.5.0.2 (X11/20060501)
Atsushi Nemoto wrote:
> On Wed, 05 Jul 2006 15:58:52 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> 
> wrote:
>> BTW why using __pa(OFFSET) ? isn't it going to yield always into 0 ?
>> At least on MIPS, it's defined as
>>
>> #define __pa(x)      ((unsigned long) (x) - PAGE_OFFSET)
>>
>> why not using ARCH_PFN_OFFSET instead ?
> 
> Indeed.  I copied the code from free_area_init().  I think 0 is enough
> for MIPS.  Patch revised.  Thank you for comments.
> 
> 

Ok thinking more about it, some platforms may have physical memory
that doesn't start at 0. MIPS doesn't support such platform though it
should be fairly easy. In that case __pa should be defined as:

        #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET + 
PFN_PHYS(ARCH_PFN_OFFSET))

and use in your patch:

        free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, 
zholes_size);

So I would recommend to use ARCH_PFN_OFFSET.

                Franck

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