[PATCH v5 33/38] mm: eliminate VMA_SPECIAL_FLAGS usage when hugetlb explicitly tested

Lorenzo Stoakes (ARM) ljs at kernel.org
Tue Oct 13 04:43:19 PDT 2026


On Mon, Oct 12, 2026 at 08:49:11PM +0200, David Hildenbrand (Arm) wrote:
> On 10/9/26 20:04, Lorenzo Stoakes (ARM) wrote:

> > diff --git a/mm/ksm.c b/mm/ksm.c
> > index 624f37975e12..ed66a90e0031 100644
> > --- a/mm/ksm.c
> > +++ b/mm/ksm.c
> > @@ -747,9 +747,7 @@ static bool ksm_compatible(const struct file *file, vma_flags_t vma_flags)
> >  	if (vma_flags_test_any(&vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT,
> >  			       VMA_HUGETLB_BIT))
> >  		return false;
> > -	if (vma_flags_test_single_mask(&vma_flags, VMA_DROPPABLE))
> > -		return false;
> > -	if (vma_flags_test_any_mask(&vma_flags, VMA_SPECIAL_FLAGS))
> > +	if (!vma_flags_is_mm_backed(&vma_flags))
> >  		return false;
>
> Same here, it's hard for me to tell my brain that "permanently lazyfree pages
> are not backed by core-mm".

Yeah :) 'mm backed' is definitely too broad for this.

Will reinstate the explicit droppable check in v6.

>
> Acked-by: David Hildenbrand (Arm) <david at kernel.org>

Thanks!

--
Cheers, Lorenzo



More information about the kvm-riscv mailing list