[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc2e1664-cff1-de1e-2087-475ec7c6aa56@nvidia.com>
Date: Sat, 29 Feb 2020 12:07:01 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Claudio Imbrenda <imbrenda@...ux.ibm.com>
CC: Christian Borntraeger <borntraeger@...ibm.com>,
<linux-next@...r.kernel.org>, <akpm@...ux-foundation.org>,
<david@...hat.com>, <aarcange@...hat.com>, <linux-mm@...ck.org>,
<frankja@...ux.ibm.com>, <sfr@...b.auug.org.au>,
<linux-kernel@...r.kernel.org>, <linux-s390@...r.kernel.org>,
Will Deacon <will@...nel.org>
Subject: Re: [RFC v1 2/2] mm/gup/writeback: add callbacks for inaccessible
pages
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
Powered by blists - more mailing lists