Re: [RFC PATCH] mm: madvise: don't split a PMD on partial THP MADV_DONTNEED
From: Pedro Falcato
Date: Fri Dec 04 2026 - 04:21:37 EST
On Thu, Dec 03, 2026 at 12:07:54PM -0800, Shakeel Butt wrote:
> On Thu, Dec 03, 2026 at 04:36:31PM +0100, Alexandre Ghiti wrote:
<snip>
> > >
> > > MADV_NOHUGEPAGE? But that requires a VMA split, which sucks. I had the
> > > idea (from Kiryl IIRC) on my post-LPC list that splitting off these
> > > hints onto a separate tree (freeing us from VMA splitting) could be a
> > > good idea.
> > >
> >
> > I thought about using MADV_NOHUGEPAGE indeed (and all the other
> > madvise flags)...The hint tree sounds like a nice idea indeed.
> >
>
> MADV_NOHUGEPAGE takes mmap lock in write mode and malloc implementations are not
> keep to do operations that take mmap_lock in write mode.
Right, that would be the point of the separate hint tree. Though I don't know
if the maple tree lock would prove to be a challenge there. But we could
definitely avoid the mmap lock in write.
--
Pedro