|
@@ -495,6 +495,14 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
|
|
goto unlock_oom;
|
|
goto unlock_oom;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Tell all users of get_user/copy_from_user etc... that the content
|
|
|
|
+ * is no longer stable. No barriers really needed because unmapping
|
|
|
|
+ * should imply barriers already and the reader would hit a page fault
|
|
|
|
+ * if it stumbled over a reaped memory.
|
|
|
|
+ */
|
|
|
|
+ set_bit(MMF_UNSTABLE, &mm->flags);
|
|
|
|
+
|
|
tlb_gather_mmu(&tlb, mm, 0, -1);
|
|
tlb_gather_mmu(&tlb, mm, 0, -1);
|
|
for (vma = mm->mmap ; vma; vma = vma->vm_next) {
|
|
for (vma = mm->mmap ; vma; vma = vma->vm_next) {
|
|
if (is_vm_hugetlb_page(vma))
|
|
if (is_vm_hugetlb_page(vma))
|