]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARC: [mm] Zero page optimization
authorVineet Gupta <vgupta@synopsys.com>
Sun, 19 May 2013 10:21:03 +0000 (15:51 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Sat, 25 May 2013 08:58:29 +0000 (14:28 +0530)
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/mm/tlb.c

index fe1c5a073afe4cf996d28b6486c6b296fbd94344..9d96b9ecb528090d363248ab915554b210431ef2 100644 (file)
@@ -432,9 +432,14 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr_unaligned,
 {
        unsigned long vaddr = vaddr_unaligned & PAGE_MASK;
        unsigned long paddr = pte_val(*ptep) & PAGE_MASK;
+       struct page *page = pfn_to_page(pte_pfn(*ptep));
 
        create_tlb(vma, vaddr, ptep);
 
+       if (page == ZERO_PAGE(0)) {
+               return;
+       }
+
        /*
         * Exec page : Independent of aliasing/page-color considerations,
         *             since icache doesn't snoop dcache on ARC, any dirty
@@ -446,7 +451,6 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr_unaligned,
         */
        if ((vma->vm_flags & VM_EXEC) ||
             addr_not_cache_congruent(paddr, vaddr)) {
-               struct page *page = pfn_to_page(pte_pfn(*ptep));
 
                int dirty = test_and_clear_bit(PG_arch_1, &page->flags);
                if (dirty) {