From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,yajun.deng@linux.dev,akpm@linux-foundation.org
Subject: + mm-mmap-add-case-9-in-vma_merge.patch added to mm-unstable branch
Date: Sun, 18 Feb 2024 13:30:04 -0800 [thread overview]
Message-ID: <20240218213005.6CD82C433F1@smtp.kernel.org> (raw)
The patch titled
Subject: mm/mmap: Add case 9 in vma_merge()
has been added to the -mm mm-unstable branch. Its filename is
mm-mmap-add-case-9-in-vma_merge.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mmap-add-case-9-in-vma_merge.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
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 via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Yajun Deng <yajun.deng@linux.dev>
Subject: mm/mmap: Add case 9 in vma_merge()
Date: Sun, 18 Feb 2024 16:50:28 +0800
If the prev vma exists and the end is less than the end of prev, we
can return NULL immediately. This reduces unnecessary operations.
Link: https://lkml.kernel.org/r/20240218085028.3294332-1-yajun.deng@linux.dev
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/mmap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/mm/mmap.c~mm-mmap-add-case-9-in-vma_merge
+++ a/mm/mmap.c
@@ -827,7 +827,7 @@ can_vma_merge_after(struct vm_area_struc
*
* **** **** ****
* PPPPPPNNNNNN PPPPPPNNNNNN PPPPPPCCCCCC
- * cannot merge might become might become
+ * cannot merge 9 might become might become
* PPNNNNNNNNNN PPPPPPPPPPCC
* mmap, brk or case 4 below case 5 below
* mremap move:
@@ -890,6 +890,9 @@ static struct vm_area_struct
if (vm_flags & VM_SPECIAL)
return NULL;
+ if (prev && end < prev->vm_end) /* case 9 */
+ return NULL;
+
/* Does the input range span an existing VMA? (cases 5 - 8) */
curr = find_vma_intersection(mm, prev ? prev->vm_end : 0, end);
_
Patches currently in -mm which might be from yajun.deng@linux.dev are
mm-mmap-simplify-vma-link-and-unlink.patch
mm-mmap-introduce-vma_set_range.patch
mm-mmap-use-sz_8k-128k-helper-macro.patch
mm-mmap-pass-vma-to-vma_merge.patch
mm-mmap-add-case-9-in-vma_merge.patch
reply other threads:[~2024-02-18 21:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240218213005.6CD82C433F1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=mm-commits@vger.kernel.org \
--cc=yajun.deng@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.