Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=701dfbc1cbdd42b814dd76a885c4b73f97011d08
Commit:     701dfbc1cbdd42b814dd76a885c4b73f97011d08
Parent:     8339f0008c47cdd921c73f6d53d5588b5484f93c
Author:     Hugh Dickins <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 29 21:24:08 2007 +0000
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jan 30 08:33:32 2007 -0800

    [PATCH] mm: mremap correct rmap accounting
    
    Nick Piggin points out that page accounting on MIPS multiple ZERO_PAGEs
    is not maintained by its move_pte, and could lead to freeing a ZERO_PAGE.
    
    Instead of complicating that move_pte, just forget the minor optimization
    when mremapping, and change the one thing which needed it for correctness
    - filemap_xip use ZERO_PAGE(0) throughout instead of according to address.
    
    [ "There is no block device driver one could use for XIP on mips
       platforms" - Carsten Otte ]
    
    Signed-off-by: Hugh Dickins <[EMAIL PROTECTED]>
    Cc: Nick Piggin <[EMAIL PROTECTED]>
    Cc: Andrew Morton <[EMAIL PROTECTED]>
    Cc: Ralf Baechle <[EMAIL PROTECTED]>
    Cc: Carsten Otte <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-mips/pgtable.h |   10 ----------
 mm/filemap_xip.c           |    4 ++--
 mm/mremap.c                |    1 -
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index f2e1325..3fcfd79 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -69,16 +69,6 @@ extern unsigned long zero_page_mask;
 #define ZERO_PAGE(vaddr) \
        (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & 
zero_page_mask))))
 
-#define __HAVE_ARCH_MOVE_PTE
-#define move_pte(pte, prot, old_addr, new_addr)                                
\
-({                                                                     \
-       pte_t newpte = (pte);                                           \
-       if (pte_present(pte) && pfn_valid(pte_pfn(pte)) &&              \
-                       pte_page(pte) == ZERO_PAGE(old_addr))           \
-               newpte = mk_pte(ZERO_PAGE(new_addr), (prot));           \
-       newpte;                                                         \
-})
-
 extern void paging_init(void);
 
 /*
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index 45b3553..9dd9fbb 100644
--- a/mm/filemap_xip.c
+++ b/mm/filemap_xip.c
@@ -183,7 +183,7 @@ __xip_unmap (struct address_space * mapping,
                address = vma->vm_start +
                        ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
                BUG_ON(address < vma->vm_start || address >= vma->vm_end);
-               page = ZERO_PAGE(address);
+               page = ZERO_PAGE(0);
                pte = page_check_address(page, mm, address, &ptl);
                if (pte) {
                        /* Nuke the page table entry. */
@@ -246,7 +246,7 @@ xip_file_nopage(struct vm_area_struct * area,
                __xip_unmap(mapping, pgoff);
        } else {
                /* not shared and writable, use ZERO_PAGE() */
-               page = ZERO_PAGE(address);
+               page = ZERO_PAGE(0);
        }
 
 out:
diff --git a/mm/mremap.c b/mm/mremap.c
index 9c769fa..5d4bd4f 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -105,7 +105,6 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t 
*old_pmd,
                if (pte_none(*old_pte))
                        continue;
                pte = ptep_clear_flush(vma, old_addr, old_pte);
-               /* ZERO_PAGE can be dependant on virtual addr */
                pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
                set_pte_at(mm, new_addr, new_pte, pte);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-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