Re: [RFC v1 2/2] mm/gup/writeback: add callbacks for inaccessible pages

John Hubbard
2020-02-29T20:07:02Z

On 2/29/20 2:49 AM, Claudio Imbrenda wrote:
>> ...
>>>> @@ -458,7 +457,6 @@ static struct page *follow_page_pte(struct
>>>> vm_area_struct *vma, }
>>>>
>>>> if (flags & FOLL_SPLIT && PageTransCompound(page)) {
>>>> - int ret;
>>>> get_page(page);
>>>> pte_unmap_unlock(ptep, ptl);
>>>> lock_page(page);
>>>> @@ -475,6 +473,14 @@ static struct page *follow_page_pte(struct
>>>> vm_area_struct *vma, page = ERR_PTR(-ENOMEM);
>>>> goto out;
>>>> }
>>>> + if (flags & FOLL_PIN) {
>>
>>
>> What about FOLL_GET? Unless your calling code has some sort of
>> BUG_ON(flags & FOLL_GET), I'm not sure it's a good idea to leave that
>> case unhandled.
>
> if I understood the semantics of FOLL_PIN correctly, then we don't need
> to make the page accessible for FOLL_GET. FOLL_PIN indicates intent to
> access the content of the page, whereas FOLL_GET is only for the struct
> page.
>
> if we are not touching the content of the page, there is no need to
> make it accessible
>

OK, I hope I'm not overlooking anything, but that sounds correct to me.

thanks,
--
John Hubbard
NVIDIA