summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJérôme Glisse <jglisse@redhat.com>2013-08-02 15:17:24 -0400
committerJérôme Glisse <jglisse@redhat.com>2016-04-07 13:23:23 -0400
commit6abff77f76d50c374057228baa0e01354d9bf1a1 (patch)
treed776cb91d9f79758431858ced7020301a28b9d0e /fs
parent5692a25511e0da564d0f5a554ac9f39197b2358f (diff)
mmu_notifier: add event information to address invalidation v9
The event information will be useful for new user of mmu_notifier API. The event argument differentiate between a vma disappearing, a page being write protected or simply a page being unmaped. This allow new user to take different path for different event for instance on unmap the resource used to track a vma are still valid and should stay around. While if the event is saying that a vma is being destroy it means that any resources used to track this vma can be free. Changed since v1: - renamed action into event (updated commit message too). - simplified the event names and clarified their usage also documenting what exceptation the listener can have in respect to each event. Changed since v2: - Avoid crazy name. - Do not move code that do not need to move. Changed since v3: - Separate huge page split from mlock/munlock and softdirty. Changed since v4: - Rebase (no other changes). Changed since v5: - Typo fix. - Changed zap_page_range from MMU_MUNMAP to MMU_MIGRATE to reflect the fact that the address range is still valid just the page backing it are no longer. Changed since v6: - try_to_unmap_one() only invalidate when doing migration. - Differentiate fork from other case. Changed since v7: - Renamed MMU_HUGE_PAGE_SPLIT to MMU_HUGE_PAGE_SPLIT. - Renamed MMU_ISDIRTY to MMU_CLEAR_SOFT_DIRTY. - Renamed MMU_WRITE_PROTECT to MMU_KSM_WRITE_PROTECT. - English syntax fixes. Changed since v8: - Added freeze/unfreeze for new huge page splitting. Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Reviewed-by: Rik van Riel <riel@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/task_mmu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 229cb546bee0..3101b70dd273 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1051,11 +1051,13 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
downgrade_write(&mm->mmap_sem);
break;
}
- mmu_notifier_invalidate_range_start(mm, 0, -1);
+ mmu_notifier_invalidate_range_start(mm, 0, -1,
+ MMU_CLEAR_SOFT_DIRTY);
}
walk_page_range(0, ~0UL, &clear_refs_walk);
if (type == CLEAR_REFS_SOFT_DIRTY)
- mmu_notifier_invalidate_range_end(mm, 0, -1);
+ mmu_notifier_invalidate_range_end(mm, 0, -1,
+ MMU_CLEAR_SOFT_DIRTY);
flush_tlb_mm(mm);
up_read(&mm->mmap_sem);
out_mm: