--- include/linux/mmu_notifier.h | 29 +++++++++++++---------------- mm/filemap_xip.c | 4 ++-- mm/fremap.c | 4 ++-- mm/hugetlb.c | 4 ++-- mm/memory.c | 17 ++++++++--------- mm/mmu_notifier.c | 12 ++++++------ mm/mprotect.c | 4 ++-- mm/mremap.c | 5 ++--- mm/rmap.c | 12 ++++++------ 9 files changed, 43 insertions(+), 48 deletions(-) Index: linux-2.6/include/linux/mmu_notifier.h =================================================================== --- linux-2.6.orig/include/linux/mmu_notifier.h 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/include/linux/mmu_notifier.h 2008-04-17 18:06:59.000000000 -0700 @@ -30,16 +30,13 @@ struct mmu_notifier_ops { unsigned long address); /* - * invalidate_range_start() and invalidate_range_end() must be - * paired. Multiple invalidate_range_start/ends may be nested + * start() and end() must be paired. Multiple start/ends may be nested * or called concurrently. */ - void (*invalidate_range_start)(struct mmu_notifier *mn, - struct mm_struct *mm, - unsigned long start, unsigned long end); - void (*invalidate_range_end)(struct mmu_notifier *mn, - struct mm_struct *mm, - unsigned long start, unsigned long end); + void (*start)(struct mmu_notifier *mn, struct mm_struct *mm, + unsigned long start, unsigned long end); + void (*end)(struct mmu_notifier *mn, struct mm_struct *mm, + unsigned long start, unsigned long end); }; struct mmu_notifier { @@ -59,9 +56,9 @@ extern int mmu_notifier_unregister(struc extern void __mmu_notifier_release(struct mm_struct *mm); extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, unsigned long address); -extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, +extern void __mmu_notifier_start(struct mm_struct *mm, unsigned long start, unsigned long end); -extern void __mmu_notifier_invalidate_range_end(struct mm_struct *mm, +extern void __mmu_notifier_end(struct mm_struct *mm, unsigned long start, unsigned long end); @@ -79,18 +76,18 @@ static inline int mmu_notifier_clear_flu return 0; } -static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm, +static inline void mmu_notifier_start(struct mm_struct *mm, unsigned long start, unsigned long end) { if (mm_has_notifiers(mm)) - __mmu_notifier_invalidate_range_start(mm, start, end); + __mmu_notifier_start(mm, start, end); } -static inline void mmu_notifier_invalidate_range_end(struct mm_struct *mm, +static inline void mmu_notifier_end(struct mm_struct *mm, unsigned long start, unsigned long end) { if (mm_has_notifiers(mm)) - __mmu_notifier_invalidate_range_end(mm, start, end); + __mmu_notifier_end(mm, start, end); } static inline void mmu_notifier_mm_init(struct mm_struct *mm) @@ -110,12 +107,12 @@ static inline int mmu_notifier_clear_flu return 0; } -static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm, +static inline void mmu_notifier_start(struct mm_struct *mm, unsigned long start, unsigned long end) { } -static inline void mmu_notifier_invalidate_range_end(struct mm_struct *mm, +static inline void mmu_notifier_end(struct mm_struct *mm, unsigned long start, unsigned long end) { } Index: linux-2.6/mm/filemap_xip.c =================================================================== --- linux-2.6.orig/mm/filemap_xip.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/filemap_xip.c 2008-04-17 18:01:34.000000000 -0700 @@ -193,7 +193,7 @@ __xip_unmap (struct address_space * mapp BUG_ON(address < vma->vm_start || address >= vma->vm_end); pte = page_check_address(page, mm, address, &ptl); if (pte) { - mmu_notifier_invalidate_range_start(mm, address, address + PAGE_SIZE); + mmu_notifier_start(mm, address, address + PAGE_SIZE); /* Nuke the page table entry. */ flush_cache_page(vma, address, pte_pfn(*pte)); pteval = ptep_clear_flush(vma, address, pte); @@ -202,7 +202,7 @@ __xip_unmap (struct address_space * mapp BUG_ON(pte_dirty(pteval)); pte_unmap_unlock(pte, ptl); page_cache_release(page); - mmu_notifier_invalidate_range_end(mm, address, address + PAGE_SIZE); + mmu_notifier_end(mm, address, address + PAGE_SIZE); } } up_read(&mapping->i_mmap_sem); Index: linux-2.6/mm/fremap.c =================================================================== --- linux-2.6.orig/mm/fremap.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/fremap.c 2008-04-17 18:01:34.000000000 -0700 @@ -215,9 +215,9 @@ asmlinkage long sys_remap_file_pages(uns up_write(&mapping->i_mmap_sem); } - mmu_notifier_invalidate_range_start(mm, start, start + size); + mmu_notifier_start(mm, start, start + size); err = populate_range(mm, vma, start, size, pgoff); - mmu_notifier_invalidate_range_end(mm, start, start + size); + mmu_notifier_end(mm, start, start + size); if (!err && !(flags & MAP_NONBLOCK)) { if (unlikely(has_write_lock)) { downgrade_write(&mm->mmap_sem); Index: linux-2.6/mm/hugetlb.c =================================================================== --- linux-2.6.orig/mm/hugetlb.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/hugetlb.c 2008-04-17 18:01:34.000000000 -0700 @@ -800,7 +800,7 @@ void __unmap_hugepage_range(struct vm_ar BUG_ON(start & ~HPAGE_MASK); BUG_ON(end & ~HPAGE_MASK); - mmu_notifier_invalidate_range_start(mm, start, end); + mmu_notifier_start(mm, start, end); spin_lock(&mm->page_table_lock); for (address = start; address < end; address += HPAGE_SIZE) { ptep = huge_pte_offset(mm, address); @@ -821,7 +821,7 @@ void __unmap_hugepage_range(struct vm_ar } spin_unlock(&mm->page_table_lock); flush_tlb_range(vma, start, end); - mmu_notifier_invalidate_range_end(mm, start, end); + mmu_notifier_end(mm, start, end); list_for_each_entry_safe(page, tmp, &page_list, lru) { list_del(&page->lru); put_page(page); Index: linux-2.6/mm/memory.c =================================================================== --- linux-2.6.orig/mm/memory.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/memory.c 2008-04-17 18:01:34.000000000 -0700 @@ -619,7 +619,7 @@ int copy_page_range(struct mm_struct *ds return copy_hugetlb_page_range(dst_mm, src_mm, vma); if (is_cow_mapping(vma->vm_flags)) - mmu_notifier_invalidate_range_start(src_mm, addr, end); + mmu_notifier_start(src_mm, addr, end); dst_pgd = pgd_offset(dst_mm, addr); src_pgd = pgd_offset(src_mm, addr); @@ -633,8 +633,7 @@ int copy_page_range(struct mm_struct *ds } while (dst_pgd++, src_pgd++, addr = next, addr != end); if (is_cow_mapping(vma->vm_flags)) - mmu_notifier_invalidate_range_end(src_mm, - vma->vm_start, end); + mmu_notifier_end(src_mm, vma->vm_start, end); return 0; } @@ -838,7 +837,7 @@ unsigned long unmap_vmas(struct vm_area_ tlb = tlb_gather_mmu(mm, 0); update_hiwater_rss(mm); fullmm = tlb->fullmm; - mmu_notifier_invalidate_range_start(mm, start_addr, end_addr); + mmu_notifier_start(mm, start_addr, end_addr); for ( ; vma && vma->vm_start < end_addr; vma = vma->vm_next) { unsigned long end; @@ -883,7 +882,7 @@ unsigned long unmap_vmas(struct vm_area_ } } tlb_finish_mmu(tlb, start_addr, end_addr); - mmu_notifier_invalidate_range_end(mm, start_addr, end_addr); + mmu_notifier_end(mm, start_addr, end_addr); return start; /* which is now the end (or restart) address */ } @@ -1468,7 +1467,7 @@ int apply_to_page_range(struct mm_struct int err; BUG_ON(addr >= end); - mmu_notifier_invalidate_range_start(mm, start, end); + mmu_notifier_start(mm, start, end); pgd = pgd_offset(mm, addr); do { next = pgd_addr_end(addr, end); @@ -1476,7 +1475,7 @@ int apply_to_page_range(struct mm_struct if (err) break; } while (pgd++, addr = next, addr != end); - mmu_notifier_invalidate_range_end(mm, start, end); + mmu_notifier_end(mm, start, end); return err; } EXPORT_SYMBOL_GPL(apply_to_page_range); @@ -1698,8 +1697,8 @@ unlock: if (new_page) { if (new_page == old_page) { /* cow happened, notify before releasing old_page */ - mmu_notifier_invalidate_range_start(mm, address, address + PAGE_SIZE); - mmu_notifier_invalidate_range_end(mm, address, address + PAGE_SIZE); + mmu_notifier_start(mm, address, address + PAGE_SIZE); + mmu_notifier_end(mm, address, address + PAGE_SIZE); } page_cache_release(new_page); } Index: linux-2.6/mm/mmu_notifier.c =================================================================== --- linux-2.6.orig/mm/mmu_notifier.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/mmu_notifier.c 2008-04-17 18:01:34.000000000 -0700 @@ -51,25 +51,25 @@ int __mmu_notifier_clear_flush_young(str return young; } -void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, +void __mmu_notifier_start(struct mm_struct *mm, unsigned long start, unsigned long end) { struct mmu_notifier *mn; list_for_each_entry(mn, &mm->mmu_notifier_list, list) { - if (mn->ops->invalidate_range_start) - mn->ops->invalidate_range_start(mn, mm, start, end); + if (mn->ops->start) + mn->ops->start(mn, mm, start, end); } } -void __mmu_notifier_invalidate_range_end(struct mm_struct *mm, +void __mmu_notifier_end(struct mm_struct *mm, unsigned long start, unsigned long end) { struct mmu_notifier *mn; list_for_each_entry(mn, &mm->mmu_notifier_list, list) { - if (mn->ops->invalidate_range_end) - mn->ops->invalidate_range_end(mn, mm, start, end); + if (mn->ops->end) + mn->ops->end(mn, mm, start, end); } } Index: linux-2.6/mm/mprotect.c =================================================================== --- linux-2.6.orig/mm/mprotect.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/mprotect.c 2008-04-17 18:01:34.000000000 -0700 @@ -199,12 +199,12 @@ success: dirty_accountable = 1; } - mmu_notifier_invalidate_range_start(mm, start, end); + mmu_notifier_start(mm, start, end); if (is_vm_hugetlb_page(vma)) hugetlb_change_protection(vma, start, end, vma->vm_page_prot); else change_protection(vma, start, end, vma->vm_page_prot, dirty_accountable); - mmu_notifier_invalidate_range_end(mm, start, end); + mmu_notifier_end(mm, start, end); vm_stat_account(mm, oldflags, vma->vm_file, -nrpages); vm_stat_account(mm, newflags, vma->vm_file, nrpages); return 0; Index: linux-2.6/mm/mremap.c =================================================================== --- linux-2.6.orig/mm/mremap.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/mremap.c 2008-04-17 18:01:34.000000000 -0700 @@ -78,8 +78,7 @@ static void move_ptes(struct vm_area_str unsigned long old_start; old_start = old_addr; - mmu_notifier_invalidate_range_start(vma->vm_mm, - old_start, old_end); + mmu_notifier_start(vma->vm_mm, old_start, old_end); if (vma->vm_file) { /* * Subtle point from Rajesh Venkatasubramanian: before @@ -119,7 +118,7 @@ static void move_ptes(struct vm_area_str spin_unlock(new_ptl); pte_unmap_nested(new_pte - 1); pte_unmap_unlock(old_pte - 1, old_ptl); - mmu_notifier_invalidate_range_end(vma->vm_mm, old_start, old_end); + mmu_notifier_end(vma->vm_mm, old_start, old_end); if (mapping) up_write(&mapping->i_mmap_sem); } Index: linux-2.6/mm/rmap.c =================================================================== --- linux-2.6.orig/mm/rmap.c 2008-04-17 17:57:16.000000000 -0700 +++ linux-2.6/mm/rmap.c 2008-04-17 18:01:34.000000000 -0700 @@ -465,7 +465,7 @@ static int page_mkclean_one(struct page if (address == -EFAULT) goto out; - mmu_notifier_invalidate_range_start(mm, address, address + PAGE_SIZE); + mmu_notifier_start(mm, address, address + PAGE_SIZE); pte = page_check_address(page, mm, address, &ptl); if (!pte) goto out_notifier; @@ -484,7 +484,7 @@ static int page_mkclean_one(struct page pte_unmap_unlock(pte, ptl); out_notifier: - mmu_notifier_invalidate_range_start(mm, address, address + PAGE_SIZE); + mmu_notifier_start(mm, address, address + PAGE_SIZE); out: return ret; @@ -729,7 +729,7 @@ static int try_to_unmap_one(struct page if (address == -EFAULT) goto out; - mmu_notifier_invalidate_range_start(mm, address, address + PAGE_SIZE); + mmu_notifier_start(mm, address, address + PAGE_SIZE); pte = page_check_address(page, mm, address, &ptl); if (!pte) goto out_notifier; @@ -802,7 +802,7 @@ static int try_to_unmap_one(struct page out_unmap: pte_unmap_unlock(pte, ptl); out_notifier: - mmu_notifier_invalidate_range_start(mm, address, address + PAGE_SIZE); + mmu_notifier_end(mm, address, address + PAGE_SIZE); out: return ret; } @@ -863,7 +863,7 @@ static void try_to_unmap_cluster(unsigne return; start = address; - mmu_notifier_invalidate_range_start(mm, start, end); + mmu_notifier_start(mm, start, end); pte = pte_offset_map_lock(mm, pmd, address, &ptl); /* Update high watermark before we lower rss */ @@ -896,7 +896,7 @@ static void try_to_unmap_cluster(unsigne (*mapcount)--; } pte_unmap_unlock(pte - 1, ptl); - mmu_notifier_invalidate_range_end(mm, start, end); + mmu_notifier_end(mm, start, end); } static int try_to_unmap_anon(struct page *page, int migration)