Small problem with pmd_page in 2.5

From: Pete Zaitcev (
Date: Sun Aug 04 2002 - 11:57:30 EST


I was looking a little bit at sparc(32) and ran into a difficulty
with pmd_page. The 2.5 version returns struct page*, presumably
to support page tables in highmem. Unfortunately, sparc (sun4m
actually) cannot do that, because its page tables are smaller
than memory pages.

This is the only code fragment that makes use of pmd_page:

static inline void free_one_pmd(mmu_gather_t *tlb, pmd_t * dir)
        struct page *pte;

        if (pmd_none(*dir))
        if (pmd_bad(*dir)) {
        pte = pmd_page(*dir);
        pte_free_tlb(tlb, pte);

Has anyone got an idea how to fix this? I've got some, but all seem bad:

 a) Use 2 lower bits of the page pointer to store an index and
    have pte_free to mask it out (possibly change pmd_page to return void*),
 b) Map the page table temporarily in pmd_page,
 c) Create a new architecture function pmd_zap which contains
    the sequence { tmp = pmd_page(); pmd_clear(); pte_free_tlb(tmp); }
    on all architectures except sparc,
 d) Copy *dir into tmp instead of pte as we do now explicitly,
    if that can work, say, on s390

-- Pete
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 : Wed Aug 07 2002 - 22:00:24 EST