Re: [PATCH 05/12] fs/proc/task_mmu: write-protect device-private THPs in PAGEMAP_SCAN
From: Lorenzo Stoakes (ARM)
Date: Mon Nov 16 2026 - 09:46:24 EST
On Fri, Nov 13, 2026 at 12:08:26AM -0500, Gregory Price (Meta) wrote:
> On 2026-11-12 19:34 +0000, Lorenzo Stoakes (ARM) wrote:
> > On Wed, Nov 11, 2026 at 12:55:13PM -0500, Tal Zussman wrote:
> > > but does nothing for a device-private THP. The PMD never gets the uffd
> > > bit.
> >
> > Sigh yeah. Device-private feels like another 'just have to happen to know to
> > update X million open-coded parts of the code'.
> >
> > We really need to find a way to abstract this stuff.
> >
>
> I've poked at it a bit, but zone device creates this issue in many
> places. The core issue is really that softleaf can mean 20 things,
> and the number of things has been piled on heavily.
>
> I don't know how we solve this, it's just a rats nest of complexity
> at this point.
And you are our Jack Russell? ;)
TBH we need some generic handlers for softleaf cases. The fact it's
abstracted in a form that we can describe clearly it might be possible to
pull useful things out of that.
Like:
softleaf_can_xxx()
softleaf_should_yyy()
etc.
Ideally we'd have entirely shared page table code but that seems like a far
off goal esp. in the face of the schloppgeddon.
But in the meantime maybe we can use semantic helpers to at least
generalise the glue between softleaf X requires handling Y?
>
> --
> ~Gregory
>
--
Cheers, Lorenzo