The patch titled Subject: mm/mmap.c: make vma_merge() comment more easy to understand has been added to the -mm tree. Its filename is mm-mmapc-make-vma_merge-comment-more-easy-to-understand.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-mmapc-make-vma_merge-comment-more-easy-to-understand.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-mmapc-make-vma_merge-comment-more-easy-to-understand.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/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Subject: mm/mmap.c: make vma_merge() comment more easy to understand Case 1/6, 2/7 and 3/8 have the same pattern and we handle them in the same logic. Rearrange the comment to make it a little easy for audience to understand. Link: http://lkml.kernel.org/r/20191030012445.16944-1-richardw.yang@xxxxxxxxxxxxxxx Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Jann Horn <jannh@xxxxxxxxxx> Cc: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Cc: Steve Capper <steve.capper@xxxxxxx> Cc: Michel Lespinasse <walken@xxxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: Yangtao Li <tiny.windzz@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) --- a/mm/mmap.c~mm-mmapc-make-vma_merge-comment-more-easy-to-understand +++ a/mm/mmap.c @@ -1091,15 +1091,18 @@ can_vma_merge_after(struct vm_area_struc * the area passed down from mprotect_fixup, never extending beyond one * vma, PPPPPP is the prev vma specified, and NNNNNN the next vma after: * - * AAAA AAAA AAAA AAAA - * PPPPPPNNNNNN PPPPPPNNNNNN PPPPPPNNNNNN PPPPNNNNXXXX - * cannot merge might become might become might become - * PPNNNNNNNNNN PPPPPPPPPPNN PPPPPPPPPPPP 6 or - * mmap, brk or case 4 below case 5 below PPPPPPPPXXXX 7 or - * mremap move: PPPPXXXXXXXX 8 - * AAAA - * PPPP NNNN PPPPPPPPPPPP PPPPPPPPNNNN PPPPNNNNNNNN - * might become case 1 below case 2 below case 3 below + * AAAA AAAA AAAA + * PPPPPPNNNNNN PPPPPPNNNNNN PPPPPPNNNNNN + * cannot merge might become might become + * PPNNNNNNNNNN PPPPPPPPPPNN + * mmap, brk or case 4 below case 5 below + * mremap move: + * AAAA AAAA + * PPPP NNNN PPPPNNNNXXXX + * might become might become + * PPPPPPPPPPPP 1 or PPPPPPPPPPPP 6 or + * PPPPPPPPNNNN 2 or PPPPPPPPXXXX 7 or + * PPPPNNNNNNNN 3 PPPPXXXXXXXX 8 * * It is important for case 8 that the vma NNNN overlapping the * region AAAA is never going to extended over XXXX. Instead XXXX must _ Patches currently in -mm which might be from richardw.yang@xxxxxxxxxxxxxxx are mm-mmapc-remove-a-never-trigger-warning-in-__vma_adjust.patch mm-mmapc-prev-could-be-retrieved-from-vma-vm_prev.patch mm-mmapc-__vma_unlink_prev-is-not-necessary-now.patch mm-mmapc-extract-__vma_unlink_list-as-counter-part-for-__vma_link_list.patch mm-mmapc-rb_parent-is-not-necessary-in-__vma_link_list.patch mm-rmapc-dont-reuse-anon_vma-if-we-just-want-a-copy.patch mm-rmapc-reuse-mergeable-anon_vma-as-parent-when-fork.patch hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash.patch mm-mmapc-make-vma_merge-comment-more-easy-to-understand.patch userfaultfd-use-vma_pagesize-for-all-huge-page-size-calculation.patch userfaultfd-remove-unnecessary-warn_on-in-__mcopy_atomic_hugetlb.patch userfaultfd-wrap-the-common-dst_vma-check-into-an-inlined-function.patch mm-fix-typo-in-the-comment-when-calling-function-__setpageuptodate.patch