[PATCH v2 2/2] mm/memfd_luo: keep memfd frozen until finish
Samiullah Khawaja
skhawaja at google.com
Tue Nov 10 10:36:39 PST 2026
On Tue, Nov 10, 2026 at 06:58:53PM +0100, Pratyush Yadav wrote:
>From: "Pratyush Yadav (Google)" <pratyush at kernel.org>
>
>After a memfd is retrieved, it immediately goes back into "normal"
>operation. The file comes back unfrozen, and its pages can migrate, it
>can be truncated, and so on. If the memfd is depended on by something,
>like iommufd, that can open a window for folios to move around before
>the consumer can re-establish its references.
>
>Finish is the conceptual point when a retrieved file can start to behave
>as "normal". So take an extra reference on the folios and freeze the
>memfd on retrieve until finish.
>
>Suggested-by: Pasha Tatashin <pasha.tatashin at soleen.com>
>Reviewed-by: Pasha Tatashin <pasha.tatashin at soleen.com>
>Signed-off-by: Pratyush Yadav (Google) <pratyush at kernel.org>
>---
> mm/memfd_luo.c | 87 +++++++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 68 insertions(+), 19 deletions(-)
>
Reviewed-by: Samiullah Khawaja <skhawaja at google.com>
More information about the kexec
mailing list