tree c31bd23fe74038b4bab5148e17e07745b75b453d
parent 146425a316fb937fbdcac018b34a23c67d12214b
author Hugh Dickins <[EMAIL PROTECTED]> Wed, 20 Apr 2005 03:29:18 -0700
committer Linus Torvalds <[EMAIL PROTECTED](none)> Wed, 20 Apr 2005 03:29:18 
-0700

[PATCH] freepgt: hugetlb area is clean

Once we're strict about clearing away page tables, hugetlb_prefault can assume
there are no page tables left within its range.  Since the other arches
continue if !pte_none here, let i386 do the same.

Signed-off-by: Hugh Dickins <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 i386/mm/hugetlbpage.c  |   11 ++---------
 ppc64/mm/hugetlbpage.c |   37 -------------------------------------
 2 files changed, 2 insertions(+), 46 deletions(-)

Index: arch/i386/mm/hugetlbpage.c
===================================================================
--- 3246589ae0fa8f4c334247222792a9e6339b4ccc/arch/i386/mm/hugetlbpage.c  
(mode:100644 sha1:a8c45143088b7968ed9ef92b441eacadcb6bba1f)
+++ c31bd23fe74038b4bab5148e17e07745b75b453d/arch/i386/mm/hugetlbpage.c  
(mode:100644 sha1:171fc925e1e4e7c699c6222b229914b320c987c3)
@@ -249,15 +249,8 @@
                        goto out;
                }
 
-               if (!pte_none(*pte)) {
-                       pmd_t *pmd = (pmd_t *) pte;
-
-                       page = pmd_page(*pmd);
-                       pmd_clear(pmd);
-                       mm->nr_ptes--;
-                       dec_page_state(nr_page_table_pages);
-                       page_cache_release(page);
-               }
+               if (!pte_none(*pte))
+                       continue;
 
                idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
                        + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
Index: arch/ppc64/mm/hugetlbpage.c
===================================================================
--- 3246589ae0fa8f4c334247222792a9e6339b4ccc/arch/ppc64/mm/hugetlbpage.c  
(mode:100644 sha1:8665bb57e42bb77349276a36ce82b98e13ea3fac)
+++ c31bd23fe74038b4bab5148e17e07745b75b453d/arch/ppc64/mm/hugetlbpage.c  
(mode:100644 sha1:390296efe3e0b4dc32e6703204b252b782732847)
@@ -203,8 +203,6 @@
        unsigned long start = seg << SID_SHIFT;
        unsigned long end = (seg+1) << SID_SHIFT;
        struct vm_area_struct *vma;
-       unsigned long addr;
-       struct mmu_gather *tlb;
 
        BUG_ON(seg >= 16);
 
@@ -213,41 +211,6 @@
        if (vma && (vma->vm_start < end))
                return -EBUSY;
 
-       /* Clean up any leftover PTE pages in the region */
-       spin_lock(&mm->page_table_lock);
-       tlb = tlb_gather_mmu(mm, 0);
-       for (addr = start; addr < end; addr += PMD_SIZE) {
-               pgd_t *pgd = pgd_offset(mm, addr);
-               pmd_t *pmd;
-               struct page *page;
-               pte_t *pte;
-               int i;
-
-               if (pgd_none(*pgd))
-                       continue;
-               pmd = pmd_offset(pgd, addr);
-               if (!pmd || pmd_none(*pmd))
-                       continue;
-               if (pmd_bad(*pmd)) {
-                       pmd_ERROR(*pmd);
-                       pmd_clear(pmd);
-                       continue;
-               }
-               pte = (pte_t *)pmd_page_kernel(*pmd);
-               /* No VMAs, so there should be no PTEs, check just in case. */
-               for (i = 0; i < PTRS_PER_PTE; i++) {
-                       BUG_ON(!pte_none(*pte));
-                       pte++;
-               }
-               page = pmd_page(*pmd);
-               pmd_clear(pmd);
-               mm->nr_ptes--;
-               dec_page_state(nr_page_table_pages);
-               pte_free_tlb(tlb, page);
-       }
-       tlb_finish_mmu(tlb, start, end);
-       spin_unlock(&mm->page_table_lock);
-
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to