20 Aug 02:36
Handle updating of ACCESSED and DIRTY in hugetlb_fault()
From: David Gibson <david <at> gibson.dropbear.id.au>
Subject: Handle updating of ACCESSED and DIRTY in hugetlb_fault()
Newsgroups: gmane.comp.lib.libhugetlbfs.devel
Date: 2008-08-20 00:36:45 GMT
Subject: Handle updating of ACCESSED and DIRTY in hugetlb_fault()
Newsgroups: gmane.comp.lib.libhugetlbfs.devel
Date: 2008-08-20 00:36:45 GMT
The page fault path for normal pages, if the fault is neither a
no-page fault nor a write-protect fault, will update the DIRTY and
ACCESSED bits in the page table appropriately.
The hugepage fault path, however, does not do this, handling only
no-page or write-protect type faults. It assumes that either the
ACCESSED and DIRTY bits are irrelevant for hugepages (usually true,
since they are never swapped) or that they are handled by the arch
code.
This is inconvenient for some software-loaded TLB architectures, where
the _PAGE_ACCESSED (_PAGE_DIRTY) bits need to be set to enable read
(write) access to the page at the TLB miss. This could be worked
around in the arch TLB miss code, but the TLB miss fast path can be
made simple more easily if the hugetlb_fault() path handles this, as
the normal page fault path does.
Signed-off-by: David Gibson <david <at> gibson.dropbear.id.au>
---
RFC, looking to merge for 2.6.28.
Index: working-2.6/mm/hugetlb.c
===================================================================
--- working-2.6.orig/mm/hugetlb.c 2008-08-19 15:14:51.000000000 +1000
+++ working-2.6/mm/hugetlb.c 2008-08-19 15:28:27.000000000 +1000
@@ -2008,7 +2008,7 @@ int hugetlb_fault(struct mm_struct *mm,
entry = huge_ptep_get(ptep);
if (huge_pte_none(entry)) {
(Continue reading)
RSS Feed