2020-11-05 12:51:58

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH v5 05/15] mm/frame-vector: Use FOLL_LONGTERM

On Thu, Nov 05, 2020 at 10:25:24AM +0100, Daniel Vetter wrote:
> > /*
> > * If we can't determine whether or not a pte is special, then fail immediately
> > * for ptes. Note, we can still pin HugeTLB and THP as these are guaranteed not
> > * to be special.
> > *
> > * For a futex to be placed on a THP tail page, get_futex_key requires a
> > * get_user_pages_fast_only implementation that can pin pages. Thus it's still
> > * useful to have gup_huge_pmd even if we can't operate on ptes.
> > */
>
> We support hugepage faults in gpu drivers since recently, and I'm not
> seeing a pud_mkhugespecial anywhere. So not sure this works, but probably
> just me missing something again.

It means ioremap can't create an IO page PUD, it has to be broken up.

Does ioremap even create anything larger than PTEs?

Jason


2020-11-06 04:10:04

by John Hubbard

[permalink] [raw]
Subject: Re: [PATCH v5 05/15] mm/frame-vector: Use FOLL_LONGTERM

On 11/5/20 4:49 AM, Jason Gunthorpe wrote:
> On Thu, Nov 05, 2020 at 10:25:24AM +0100, Daniel Vetter wrote:
>>> /*
>>> * If we can't determine whether or not a pte is special, then fail immediately
>>> * for ptes. Note, we can still pin HugeTLB and THP as these are guaranteed not
>>> * to be special.
>>> *
>>> * For a futex to be placed on a THP tail page, get_futex_key requires a
>>> * get_user_pages_fast_only implementation that can pin pages. Thus it's still
>>> * useful to have gup_huge_pmd even if we can't operate on ptes.
>>> */
>>
>> We support hugepage faults in gpu drivers since recently, and I'm not
>> seeing a pud_mkhugespecial anywhere. So not sure this works, but probably
>> just me missing something again.
>
> It means ioremap can't create an IO page PUD, it has to be broken up.
>
> Does ioremap even create anything larger than PTEs?
>

From my reading, yes. See ioremap_try_huge_pmd().

thanks,
--
John Hubbard
NVIDIA