linux-mips
[Top] [All Lists]

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

To: vagabon.xyz@gmail.com
Subject: Re: [PATCH] do not count pages in holes with sparsemem
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Tue, 11 Jul 2006 22:24:58 +0900 (JST)
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <44B3625B.7000700@innova-card.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cda58cb80607100434h13831eb7rc6eda13a0d9e373f@mail.gmail.com> <20060710.233454.39153668.anemo@mba.ocn.ne.jp> <44B3625B.7000700@innova-card.com>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 11 Jul 2006 10:33:31 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> 
wrote:
> > We can, but we can get more precise value using page_is_ram().  The
> > pfn_valid() returns true for _all_ pages on present section, and
> > currently the section size is 256MB.
> 
> so your total pages of RAM in show_mem() is incorrect...
> 
>                if (!pfn_valid(pfn))
>                         continue;
>                 page = pfn_to_page(pfn);
>                 total++;
> 
> 
> I don't know SPARSEMEM a lot but is it allowed to have holes inside
> a section ? Shouldn't we tune the section size to avoid holes inside
> section ?

If holes exist in a section, show_mem() will count these pages as
"reserved".  You can count real pages by "total - reserved".

Talking about nr_kernel_pages (calculated by zones_size[] and
zones_holes[]) and num_physpages, these values are used to determine
sizes of some kernel data structures, it would be better to set more
precise value for them.

While large holes in a section wastes some memory, make the section
size customizable might be a good idea.  Anyone?  ;-)

---
Atsushi Nemoto

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