Re: [REGRESSION] mremap() fails VMA expansion when VM_MIXEDMAP is set
From: Lorenzo Stoakes (ARM)
Date: Fri Oct 23 2026 - 04:18:47 EST
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.
--
Cheers, Lorenzo