All of lore.kernel.org
 help / color / mirror / Atom feed
* chasing the four level page table
@ 2005-01-06 17:17 Jon Smirl
  2005-01-06 18:12 ` Andi Kleen
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Smirl @ 2005-01-06 17:17 UTC (permalink / raw)
  To: lkml

The DRM driver contains this routine:

drivers/char/drm/drm_memory.h

static inline unsigned long
drm_follow_page (void *vaddr)
{
	pgd_t *pgd = pgd_offset_k((unsigned long) vaddr);
	pud_t *pud = pud_offset(pgd, (unsigned long) vaddr);
	pmd_t *pmd = pmd_offset(pud, (unsigned long) vaddr);
	pte_t *ptep = pte_offset_kernel(pmd, (unsigned long) vaddr);
	return pte_pfn(*ptep) << PAGE_SHIFT;
}

No other driver needs to chase the page table like this so there is
probably some other way to achieve this. Can someone who knows more
about the VM system tell me if there is a way to eliminate this code?

If there are any VM/AGP experts with some free time, drm_memory.h
could use some rewriting to make it pass sparse checks.

-- 
Jon Smirl
jonsmirl@gmail.com

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

end of thread, other threads:[~2005-01-15  5:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 17:17 chasing the four level page table Jon Smirl
2005-01-06 18:12 ` Andi Kleen
2005-01-06 18:36   ` Jon Smirl
2005-01-06 19:38     ` Andi Kleen
2005-01-06 20:05       ` Jon Smirl
2005-01-06 21:41         ` Dave Jones
2005-01-08  5:22           ` Jon Smirl
2005-01-15  2:54             ` H. Peter Anvin
2005-01-15  3:37               ` Roland Dreier
2005-01-15  4:24               ` Andi Kleen
2005-01-15  5:59                 ` Jon Smirl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.