public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Small problem with pmd_page in 2.5
@ 2002-08-04 16:57 Pete Zaitcev
  2002-08-04 18:08 ` Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Pete Zaitcev @ 2002-08-04 16:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: zaitcev

Greetings:

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:
mm/memory.c:

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

        if (pmd_none(*dir))
                return;
        if (pmd_bad(*dir)) {
                pmd_ERROR(*dir);
                pmd_clear(dir);
                return;
        }
        pte = pmd_page(*dir);
        pmd_clear(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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-04 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-04 16:57 Small problem with pmd_page in 2.5 Pete Zaitcev
2002-08-04 18:08 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox