Re: [PATCH 09/19] mm: New follow_pfnmap API

David Hildenbrand
2024-08-17T11:06:04Z

On 17.08.24 01:12, Sean Christopherson wrote:
> On Fri, Aug 09, 2024, Peter Xu wrote:
>> Introduce a pair of APIs to follow pfn mappings to get entry information.
>> It's very similar to what follow_pte() does before, but different in that
>> it recognizes huge pfn mappings.
>
> ...
>
>> +int follow_pfnmap_start(struct follow_pfnmap_args *args);
>> +void follow_pfnmap_end(struct follow_pfnmap_args *args);
>
> I find the start+end() terminology to be unintuitive. E.g. I had to look at the
> implementation to understand why KVM invoke fixup_user_fault() if follow_pfnmap_start()
> failed.

It roughly matches folio_walk_start() / folio_walk_end(), that I
recently introduced.

Maybe we should call it pfnmap_walk_start() / pfnmap_walk_end() here, to
remove the old "follow" semantics for good.

>
> What about follow_pfnmap_and_lock()? And then maybe follow_pfnmap_unlock()?
> Though that second one reads a little weird.

Yes, I prefer start/end (lock/unlock reads like an implementation
detail). But whatever we do, let's try doing something that is
consistent with existing stuff.

--
Cheers,

David / dhildenb