Re: [PATCH 1/2] mm/gup: add memfd_pin_folios_supported() helper
From: Jiahao Xu
Date: Thu Nov 19 2026 - 03:43:44 EST
On 11/19/26 08:48, David Hildenbrand (Arm) wrote:
> It's odd that you would be asking an interface specific for "memfd" whether some
> random file would be supported. It's in the name: memfd.
[...]
> file_is_memfd_compatible ?
>
> Maybe there are better suggestions.
Adopted as file_is_memfd_compatible(), and I have no better suggestion:
the helper is handed a struct file, so the file should be the subject of
the question.
You are also right that "compatible" is the accurate word rather than
"is_memfd": shmem_file() matches every shmem file, not only the unlinked
ones memfd_create() produces, and file-hugetlb files are not memfds at
all. I wrote that distinction into the kdoc so the next reader does not
have to rediscover it.
Both patches were resent as v2 with that name:
<20261119163531.788514-1-xujiahao@xxxxxxxxxxxxxxxxxxxx> [PATCH v2 1/2] mm/gup: add file_is_memfd_compatible() helper
<20261119163531.315791-1-xujiahao@xxxxxxxxxxxxxxxxxxxx> [PATCH v2 2/2] iommufd: only hold references to files memfd_pin_folios() can pin
Thanks,
Jiahao