Re: [PATCH] 2.5.12: remove VALID_PAGE

From: Linus Torvalds (
Date: Wed May 01 2002 - 16:38:24 EST

On Wed, 1 May 2002, Roman Zippel wrote:
> This patch removes VALID_PAGE() and replaces it with pte_valid_page()/
> virt_to_valid_page(). The VALID_PAGE() test is basically always too late
> for configuration with discontinous memory. The real input value (the
> virtual or physical address) has to be checked. Nice side effect: the
> kernel becomes 1KB smaller.

Can you please do this differently, by splitting up the pte->page
conversion and explicitly using a physical PFN in between the two?

In other words, I'd much rather have

        unsigned long pfn = pte_pfn(pte);

        if (pfn_valid(pfn)) {
                struct page *page = pfn_to_page(pfn);

and make the physical page address visible.

The reason I'd rather do it that way is that sometimes we right now go to
"struct page" for no really good reason, other than the fact that we don't
have any other good "intermediate" representation.

So using a pte_pfn()/pfn_to_page() interface would allow other places to
take advantage of this too, instead of adding two new special-case
functions that aren't useful for anything else.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue May 07 2002 - 22:00:11 EST