]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: defer second attempt at merge on mmap()
authorLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Fri, 25 Oct 2024 12:26:27 +0000 (13:26 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:29:21 +0000 (21:29 -0700)
commit1c19bf9255b9c326efb113b3e1916815c1b8def3
treea1bb256f7ed8794e406aab6479505153e99cad29
parent20603273ec4788daa6caaa8fc42ad66542000d1a
mm: defer second attempt at merge on mmap()

Rather than trying to merge again when ostensibly allocating a new VMA,
instead defer until the VMA is added and attempt to merge the existing
range.

This way we have no complicated unwinding logic midway through the process
of mapping the VMA.

In addition this removes limitations on the VMA not being able to be the
first in the virtual memory address space which was previously implicitly
required.

In theory, for this very same reason, we should unconditionally attempt
merge here, however this is likely to have a performance impact so it is
better to avoid this given the unlikely outcome of a merge.

Link: https://lkml.kernel.org/r/d4f84502605d7651ac114587f507395c0fc76004.1729858176.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vma.c