From 701dfbc1cbdd42b814dd76a885c4b73f97011d08 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Mon, 29 Jan 2007 21:24:08 +0000 Subject: [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 Cc: Nick Piggin Cc: Andrew Morton Cc: Ralf Baechle Cc: Carsten Otte Signed-off-by: Linus Torvalds --- include/asm-mips/pgtable.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/asm-mips/pgtable.h') diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index f2e1325fec6c..3fcfd7979de5 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); /* -- cgit v1.2.3