mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luiz Capitulino <luizcap@redhat.com>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>, Jann Horn <jannh@google.com>,
	Pedro Falcato <pfalcato@suse.de>,
	David Hildenbrand <david@kernel.org>,
	Jakub Matena <matenajakub@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [REGRESSION] mremap() fails VMA expansion when VM_MIXEDMAP is set
Date: Fri, 23 Oct 2026 08:15:17 -0400	[thread overview]
Message-ID: <538f7c6f-3e16-4ab9-9b79-232b34fb4d3e@redhat.com> (raw)
In-Reply-To: <atsWop95CHj6oTSU@gremlin>



On 10/23/26 4:18 AM, Lorenzo Stoakes (ARM) wrote:
> I'll look into this but obviously we won't make mixed map regions mergeable (nor
> were they ever), that's completely broken.
> 
> The most recent version of the mm code (which is going to be send to Linus soon
> in this merge window) documents why:
> 
> /**
>   * vma_flags_can_merge() - Do the specified VMA flags permit the VMA to be
>   * merged with another?
>   * @flags: The VMA flags to test.
>   * Returns: true if the flags permit merging, false otherwise.
>   */
> static inline bool vma_flags_can_merge(const vma_flags_t *flags)
> {
> 	/*
> 	 * VMA merging assumes that a VMA's flags and fields completely describe
> 	 * its state, which is only the case for mm-backed mappings.
> 	 *
> 	 * Mappings which are not mm-managed may have established state upon
> 	 * mapping not embodied in any attribute of the VMA.
> 	 *
> 	 * Additionally, private (CoW) PFN maps encode the source PFN of the
> 	 * range in vma->vm_pgoff, which may otherwise cause spurious merges.
> 	 */
> 	if (!vma_flags_is_mm_backed(flags))
> 		return false;
> 	/*
> 	 * hugetlb mappings contain per-VMA state, so their flags and fields do
> 	 * not completely describe them.
> 	 */
> 	return !vma_flags_is_hugetlb(flags);
> }
> 
> I'll dig in + get back to you.

Thanks Lorenzo, I really appreciate it.

> 
> --
> Cheers, Lorenzo


  reply	other threads:[~2026-10-23 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  2:31 Luiz Capitulino
2026-10-23  7:16 ` Vlastimil Babka (SUSE)
2026-10-23  8:19   ` Lorenzo Stoakes (ARM)
2026-10-23 12:16     ` Luiz Capitulino
2026-10-23 12:13   ` Luiz Capitulino
2026-10-23 13:00     ` Pedro Falcato
2026-10-23 18:16       ` Luiz Capitulino
2026-10-23  8:18 ` Lorenzo Stoakes (ARM)
2026-10-23 12:15   ` Luiz Capitulino [this message]
2026-10-23 14:28     ` Lorenzo Stoakes (ARM)

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=538f7c6f-3e16-4ab9-9b79-232b34fb4d3e@redhat.com \
    --to=luizcap@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=jannh@google.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=matenajakub@gmail.com \
    --cc=pfalcato@suse.de \
    --cc=vbabka@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®