The patch titled Subject: mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7 has been added to the -mm tree. Its filename is mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7.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 *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Eric B Munson <emunson@xxxxxxxxxx> Subject: mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7 Signed-off-by: Eric B Munson <emunson@xxxxxxxxxx> Acked-by: Vlastimil Babka <vbabka@xxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mlock.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff -puN mm/mlock.c~mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7 mm/mlock.c --- a/mm/mlock.c~mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7 +++ a/mm/mlock.c @@ -578,9 +578,9 @@ static int apply_vma_lock_flags(unsigned prev = vma; for (nstart = start ; ; ) { - vm_flags_t newflags; + vm_flags_t newflags = + vma->vm_flags & ~(VM_LOCKED | VM_LOCKONFAULT); - newflags = vma->vm_flags & ~(VM_LOCKED | VM_LOCKONFAULT); newflags |= flags; /* Here we know that vma->vm_start <= nstart < vma->vm_end. */ @@ -678,7 +678,7 @@ SYSCALL_DEFINE2(munlock, unsigned long, * and translate into the appropriate modifications to mm->def_flags and/or the * flags for all current VMAs. * - * There are a couple of sublties with this. If mlockall() is called multiple + * There are a couple of subtleties with this. If mlockall() is called multiple * times with different flags, the values do not necessarily stack. If mlockall * is called once including the MCL_FUTURE flag and then a second time without * it, VM_LOCKED and VM_LOCKONFAULT will be cleared from mm->def_flags. @@ -695,13 +695,6 @@ static int apply_mlockall_flags(int flag if (flags & MCL_ONFAULT) current->mm->def_flags |= VM_LOCKONFAULT; - /* - * When there were only two flags, we used to early out if only - * MCL_FUTURE was set. Now that we have MCL_ONFAULT, we can - * only early out if MCL_FUTURE is set, but MCL_CURRENT is not. - * This is done, even though it promotes odd behavior, to - * maintain behavior from older kernels - */ if (!(flags & MCL_CURRENT)) goto out; } _ Patches currently in -mm which might be from emunson@xxxxxxxxxx are mm-mlock-refactor-mlock-munlock-and-munlockall-code.patch mm-mlock-refactor-mlock-munlock-and-munlockall-code-v7.patch mm-mlock-add-new-mlock-system-call.patch mm-mlock-add-new-mlock-system-call-v7.patch mm-introduce-vm_lockonfault.patch mm-introduce-vm_lockonfault-v7.patch mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage.patch mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage-v7.patch selftests-vm-add-tests-for-lock-on-fault.patch mips-add-entry-for-new-mlock2-syscall.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