Re: [PATCH 1/3] mm/memfd_luo: don't use memfd_pin_folios()

From: Pratyush Yadav

Date: Thu Oct 29 2026 - 09:17:45 EST


On Wed, Oct 28 2026, Pasha Tatashin wrote:

> On 10-29 00:04, Pratyush Yadav wrote:
>> > Nit:
>> >
>> > I would suggest adding another helper, memfd_luo_get_folio(inode, index,
>> > &folio), that wraps:
>> >
>> > - shmem_get_folio()
>> > - The !folio_is_longterm_pinnable() migration retry loop logic
>> >
>> > I think this would make the final code a bit more manageable.
>>
>> Sounds good, will do.
>>
>> >
>> > Other than that the patch looks alright, feel free to add
>> > Acked-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
>> > Once the nit is addressed.
>>
>> Thanks!
>>
>> I think the MM side might take some time to gather reviews so I will
>> send this out as part of a liveupdate-only series. This patch is useful
>> on its own anyway.
>
> Sounds good. Could you also consider adding a patch to that live
> update-only series to extend the memfd freeze from retrieve to finish()?
> That would close another gap that does not affect us yet, but will once
> other session fds depend on the memfd mapping.
>
> See:
> https://lore.kernel.org/r/20261022225035.377445-8-dmatlack@xxxxxxxxxx

Hmm, right. That's a useful fix. I think I'll do that in a separate
series, since it can go independently.

--
Regards,
Pratyush Yadav