Re: [PATCH] 2.5.12: remove VALID_PAGE

Linus Torvalds (torvalds@transmeta.com)
Wed, 1 May 2002 14:38:24 -0700 (PDT)


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.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/