Re: [PATCH v1 05/10] mm/huge_memory: remove READ_ONLY_THP_FOR_FS from file_thp_enabled()
From: Lorenzo Stoakes (Oracle)
Date: Fri Mar 27 2026 - 12:21:17 EST
On Fri, Mar 27, 2026 at 12:12:04PM -0400, Zi Yan wrote:
> On 27 Mar 2026, at 12:08, Lorenzo Stoakes (Oracle) wrote:
> > So actually:
> >
> > | PF | MADV_COLLAPSE | khugepaged |
> > |-----------|---------------|------------|
> > large folio fs | ✓ | x | x |
> > READ_ONLY_THP_FOR_FS | x | ✓ | ✓ |
> > both! | ✓ | ✓ | ✓ |
> >
> > (Where it's impllied it's a read-only mapping obviously for the later two
> > cases.)
> >
> > Now without READ_ONLY_THP_FOR_FS you're going to:
> >
> > | PF | MADV_COLLAPSE | khugepaged |
> > |-----------|---------------|------------|
> > large folio fs | ✓ | x | x |
> > large folio + r/o | ✓ | ✓ | ✓ |
> >
> > And intentionally leaving behind the 'not large folio fs, r/o' case because
> > those file systems need to implement large folio support.
> >
> > I guess we'll regress those users but we don't care?
>
> Yes. This also motivates FSes without large folio support to add large folio
> support instead of relying on READ_ONLY_THP_FOR_FS hack.
Ack that's something I can back :)
>
> >
> > I do think all this needs to be spelled out in the commit message though as it's
> > subtle.
> >
> > Turns out this PitA config option is going to kick and scream a bit first before
> > it goes...
>
> Sure. I will shameless steal your tables. Thank you for the contribution. ;)
>
Haha good I love to spread ASCII art :)
Cheers, Lorenzo