The patch titled mlock: do not munlock pages in __do_fault() has been added to the -mm tree. Its filename is mlock-do-not-munlock-pages-in-__do_fault.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: mlock: do not munlock pages in __do_fault() From: Michel Lespinasse <walken@xxxxxxxxxx> If the page is going to be written to, __do_page needs to break COW. However, the old page (before breaking COW) was never mapped mapped into the current pte (__do_fault is only called when the pte is not present), so vmscan can't have marked the old page as PageMlocked due to being mapped in __do_fault's VMA. Therefore, __do_fault() does not need to worry about clearing PageMlocked() on the old page. Signed-off-by: Michel Lespinasse <walken@xxxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory.c | 6 ------ 1 file changed, 6 deletions(-) diff -puN mm/memory.c~mlock-do-not-munlock-pages-in-__do_fault mm/memory.c --- a/mm/memory.c~mlock-do-not-munlock-pages-in-__do_fault +++ a/mm/memory.c @@ -3051,12 +3051,6 @@ static int __do_fault(struct mm_struct * goto out; } charged = 1; - /* - * Don't let another task, with possibly unlocked vma, - * keep the mlocked page. - */ - if (vma->vm_flags & VM_LOCKED) - clear_page_mlock(vmf.page); copy_user_highpage(page, vmf.page, address, vma); __SetPageUptodate(page); } else { _ Patches currently in -mm which might be from walken@xxxxxxxxxx are origin.patch mlock-fix-race-when-munlocking-pages-in-do_wp_page.patch mlock-do-not-munlock-pages-in-__do_fault.patch mm-allow-gup-to-fail-instead-of-waiting-on-a-page.patch mm-allow-gup-to-fail-instead-of-waiting-on-a-page-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html