Re: [PATCH v2 2/4] mm/gup: handle ZONE_DEVICE pages in folio_fast_pin_allowed()
From: Martin Oliveira
Date: Wed Jun 26 2024 - 18:23:29 EST
Hi John,
Thanks for your comments and sorry for the delayed response, I was off the
last few days.
On 2024-06-14 20:40, John Hubbard wrote:
> s/folio_fast_pin_allowed/gup_fast_folio_allowed/ ?
Nice catch! That function got renamed from the original work
we did on this series.
> This comment is very difficult, because it states that one cannot
> do something, right before explicitly enable something else. And the
> reader is given little help on connecting the two.
>
> And there are several subtypes of ZONE_DEVICE. Is it really true that
> none of them can be mapped to user space? For p2p BAR1 mappings, those
> actually go to user space, yes? Confused, need help. :)
This is a fair point, I had only looked at p2p but I can't say anything
about the other subtypes of ZONE_DEVICE.
For p2p, yes, they will go to userspace, however folio->mapping was NULL
for those cases. And hence fast path would reject it.
In any case, I think we could drop this patch for now and revisit when/if
required, the regular gup path was not measurably slower.
Thanks,
Martin