From 73e941fbefe7fde75ee3f344147ec982e52bfd33 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Fri, 16 Nov 2012 14:14:48 -0800 Subject: [PATCH] --- yaml --- r: 335787 b: refs/heads/master c: 1756954c61cb5c97c618ccb366482b9c1f891d6d h: refs/heads/master i: 335785: 475b7006de4b7a340c15dd148a5c32457742d712 335783: 2ef213276089595da8d0a21800f744b139752979 v: v3 --- [refs] | 2 +- trunk/mm/memory.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 04009db9bf8e..1f99df163d7c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 63c3b902e517012b127d6528434b928ceaa10f7b +refs/heads/master: 1756954c61cb5c97c618ccb366482b9c1f891d6d diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index fb135ba4aba9..221fc9ffcab1 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -2527,9 +2527,8 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, int ret = 0; int page_mkwrite = 0; struct page *dirty_page = NULL; - unsigned long mmun_start; /* For mmu_notifiers */ - unsigned long mmun_end; /* For mmu_notifiers */ - bool mmun_called = false; /* For mmu_notifiers */ + unsigned long mmun_start = 0; /* For mmu_notifiers */ + unsigned long mmun_end = 0; /* For mmu_notifiers */ old_page = vm_normal_page(vma, address, orig_pte); if (!old_page) { @@ -2708,8 +2707,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, goto oom_free_new; mmun_start = address & PAGE_MASK; - mmun_end = (address & PAGE_MASK) + PAGE_SIZE; - mmun_called = true; + mmun_end = mmun_start + PAGE_SIZE; mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end); /* @@ -2778,7 +2776,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, page_cache_release(new_page); unlock: pte_unmap_unlock(page_table, ptl); - if (mmun_called) + if (mmun_end > mmun_start) mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); if (old_page) { /*