[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20060809141901.40003.qmail@web25814.mail.ukl.yahoo.com>
Date: Wed, 9 Aug 2006 14:19:01 +0000 (GMT)
From: moreau francis <francis_moreau2000@...oo.fr>
To: Andy Whitcroft <apw@...dowen.org>
Cc: Alan Cox <alan@...rguk.ukuu.org.uk>, linux-kernel@...r.kernel.org
Subject: Re : Re : Re : Re : sparsemem usage
Andy Whitcroft wrote:
>
> I have to re-iterate pfn_valid() does not mean pfn_valid_memory(), it
> means pfn_valid_memmap(). If you want to know if a page is valid and
> memory (at least on x86) you could use:
>
> if (pfn_valid(pfn) && page_is_ram(pfn)) {
> }
>
> It is rare you care how many real page frames there are in the system.
> You are more interested in how many usable frames there are. Such as
> for use in sizing hashes or caches. The reserved pages should be
> excluded in this calculation. ACPI pages, BIOS pages and the like
> simply are no interest.
>
> I don't see anywhere in the kernel using that construct to work out how
> many pages there are in the system. Mostly we have architectual
> information to tell us what real physical pages exist in the system such
> as the srat or e820 etc. If we really care about real page counts at
> that accuracy we have those to refer to.
>
Not all arch have page_is_ram(). OK it should be easy to have but we will
need create new data structures to keep this info. The point is that it's
really easy for memory model such sparsemem to keep this info.
> Do you have a usage model in which we really care about the number of
> pages in the system to that level of accuracy?
>
show_mem(), which is arch specific, needs to report them. And some
implementations use only pfn_valid().
thanks
Francis
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists