get_user_pages changes
Subsystems (2)
v6 cover get_user_pages changes
This version only converts put_page to put_user_page and removes an unecessary ifdef.
It does not convert atomic_pte_lookup to __get_user_pages as gru_vtop could run in an interrupt context in which we can't assume current as __get_user_pages does.
Bharath Vedartham (2):
sgi-gru: Convert put_page() to put_user_page*()
sgi-gru: Remove uneccessary ifdef for CONFIG_HUGETLB_PAGE
drivers/misc/sgi-gru/grufault.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
Signature · 1 line
2.7.4
PATCH v6 1/2 sgi-gru: Convert put_page() to put_user_page*()
For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages().
This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions").
--- drivers/misc/sgi-gru/grufault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/sgi-gru/grufault.c +1 -1
@@ -188,7 +188,7 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma,if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page); -put_page (page); +put_user_page (page);return 0 ; }
Signature · 1 line
2.7.4
PATCH v6 2/2 sgi-gru: Remove uneccessary ifdef for CONFIG_HUGETLB_PAGE
In reply to Bharath Vedarthamis_vm_hugetlb_page will always return false if CONFIG_HUGETLB_PAGE is not set.
--- drivers/misc/sgi-gru/grufault.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/misc/sgi-gru/grufault.c +11 -10
@@ -180,11 +180,11 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma, {struct page *page; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page);
@@ -238,11 +238,12 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,return 1 ; *paddr =pte_pfn (pte) <<PAGE_SHIFT ; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif + +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +return 0 ; err:
Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
In reply to Bharath VedarthamCC'ing lkml.
Quoted 42 lines · Bharath Vedartham
For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via
put_page()orrelease_pages().This is part a tree-wide conversion, as described in commit
fc1d8e7cca2d("mm: introduce put_user_page*(), placeholder versions").Cc Ira Weiny <ira.weiny at intel.com>Cc John Hubbard <jhubbard at nvidia.com>Cc J?r?me Glisse <jglisse at redhat.com>Cc Greg Kroah-Hartman <gregkh at linuxfoundation.org>Cc Dimitri Sivanich <sivanich at sgi.com>Cc Arnd Bergmann <arnd at arndb.de>Cc William Kucharski <william.kucharski at oracle.com>Cc Christoph Hellwig <hch at lst.de>Cc linux-kernel at vger.kernel.orgCc linux-mm at kvack.orgCc linux-kernel-mentees at lists.linuxfoundation.orgReviewed-by Ira Weiny <ira.weiny at intel.com>Reviewed-by John Hubbard <jhubbard at nvidia.com>Reviewed-by William Kucharski <william.kucharski at oracle.com>Signed-off-by Bharath Vedartham <linux.bhar at gmail.com>--- drivers/misc/sgi-gru/grufault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/sgi-gru/grufault.c +1
-1@@ -188,7 +188,7 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma,if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page); -put_page (page); +put_user_page (page);return 0 ; }Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH 2/2] sgi-gru: Remove uneccessary ifdef for CONFIG_HUGETLB_PAGE
In reply to Bharath VedarthamCC'ing lkml.
Quoted 64 lines · Bharath Vedartham
is_vm_hugetlb_pagewill always return false ifCONFIG_HUGETLB_PAGEis not set.Cc Ira Weiny <ira.weiny at intel.com>Cc John Hubbard <jhubbard at nvidia.com>Cc J?r?me Glisse <jglisse at redhat.com>Cc Greg Kroah-Hartman <gregkh at linuxfoundation.org>Cc Dimitri Sivanich <sivanich at sgi.com>Cc Arnd Bergmann <arnd at arndb.de>Cc William Kucharski <william.kucharski at oracle.com>Cc Christoph Hellwig <hch at lst.de>Cc linux-kernel at vger.kernel.orgCc linux-mm at kvack.orgCc linux-kernel-mentees at lists.linuxfoundation.orgReviewed-by Ira Weiny <ira.weiny at intel.com>Reviewed-by John Hubbard <jhubbard at nvidia.com>Reviewed-by William Kucharski <william.kucharski at oracle.com>Signed-off-by Bharath Vedartham <linux.bhar at gmail.com>--- drivers/misc/sgi-gru/grufault.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/misc/sgi-gru/grufault.c +11
-10@@ -180,11 +180,11 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma, {struct page *page; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page);@@ -238,11 +238,12 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,return 1 ; *paddr =pte_pfn (pte) <<PAGE_SHIFT ; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif + +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +return 0 ; err:Signature · 1 line
2.7.4
On Mon, Aug 19, 2019 at 01:08:53AM +0530, Bharath Vedartham wrote:
CC'ing lkml, the mail id was wrong.
Quoted 17 lines
This version only converts
put_pagetoput_user_pageand removes an unecessary ifdef.It does not convert
atomic_pte_lookupto__get_user_pagesasgru_vtopcould run in an interrupt context in which we can't assume current as__get_user_pagesdoes.Bharath Vedartham (2):
sgi-gru: Convertput_page()to put_user_page*()
sgi-gru: Remove uneccessary ifdef forCONFIG_HUGETLB_PAGEdrivers/misc/sgi-gru/grufault.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
In reply to Bharath VedarthamQuoted 42 lines · Bharath Vedartham
For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via
put_page()orrelease_pages().This is part a tree-wide conversion, as described in commit
fc1d8e7cca2d("mm: introduce put_user_page*(), placeholder versions").Cc Ira Weiny <ira.weiny at intel.com>Cc John Hubbard <jhubbard at nvidia.com>Cc J?r?me Glisse <jglisse at redhat.com>Cc Greg Kroah-Hartman <gregkh at linuxfoundation.org>Cc Dimitri Sivanich <sivanich at sgi.com>Cc Arnd Bergmann <arnd at arndb.de>Cc William Kucharski <william.kucharski at oracle.com>Cc Christoph Hellwig <hch at lst.de>Cc linux-kernel at vger.kernel.orgCc linux-mm at kvack.orgCc linux-kernel-mentees at lists.linuxfoundation.orgReviewed-by Ira Weiny <ira.weiny at intel.com>Reviewed-by John Hubbard <jhubbard at nvidia.com>Reviewed-by William Kucharski <william.kucharski at oracle.com>Signed-off-by Bharath Vedartham <linux.bhar at gmail.com>--- drivers/misc/sgi-gru/grufault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/sgi-gru/grufault.c +1
-1@@ -188,7 +188,7 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma,if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page); -put_page (page); +put_user_page (page);return 0 ; }Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH 2/2] sgi-gru: Remove uneccessary ifdef for CONFIG_HUGETLB_PAGE
In reply to Bharath VedarthamQuoted 64 lines · Bharath Vedartham
is_vm_hugetlb_pagewill always return false ifCONFIG_HUGETLB_PAGEis not set.Cc Ira Weiny <ira.weiny at intel.com>Cc John Hubbard <jhubbard at nvidia.com>Cc J?r?me Glisse <jglisse at redhat.com>Cc Greg Kroah-Hartman <gregkh at linuxfoundation.org>Cc Dimitri Sivanich <sivanich at sgi.com>Cc Arnd Bergmann <arnd at arndb.de>Cc William Kucharski <william.kucharski at oracle.com>Cc Christoph Hellwig <hch at lst.de>Cc linux-kernel at vger.kernel.orgCc linux-mm at kvack.orgCc linux-kernel-mentees at lists.linuxfoundation.orgReviewed-by Ira Weiny <ira.weiny at intel.com>Reviewed-by John Hubbard <jhubbard at nvidia.com>Reviewed-by William Kucharski <william.kucharski at oracle.com>Signed-off-by Bharath Vedartham <linux.bhar at gmail.com>--- drivers/misc/sgi-gru/grufault.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/misc/sgi-gru/grufault.c +11
-10@@ -180,11 +180,11 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma, {struct page *page; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page);@@ -238,11 +238,12 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,return 1 ; *paddr =pte_pfn (pte) <<PAGE_SHIFT ; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif + +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +return 0 ; err:Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
In reply to Dimitri SivanichQuoted 1 line · Dimitri Sivanich
Reviewed-by Dimitri Sivanich <sivanich at hpe.com>
Thanks!
John, would you like to take this patch into your miscellaneous conversions patch set?
Thank you
Bharath
Quoted 43 lines · Bharath Vedartham
Quoted 42 lines
For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via
put_page()orrelease_pages().This is part a tree-wide conversion, as described in commit
fc1d8e7cca2d("mm: introduce put_user_page*(), placeholder versions").Cc Ira Weiny <ira.weiny at intel.com>Cc John Hubbard <jhubbard at nvidia.com>Cc J?r?me Glisse <jglisse at redhat.com>Cc Greg Kroah-Hartman <gregkh at linuxfoundation.org>Cc Dimitri Sivanich <sivanich at sgi.com>Cc Arnd Bergmann <arnd at arndb.de>Cc William Kucharski <william.kucharski at oracle.com>Cc Christoph Hellwig <hch at lst.de>Cc linux-kernel at vger.kernel.orgCc linux-mm at kvack.orgCc linux-kernel-mentees at lists.linuxfoundation.orgReviewed-by Ira Weiny <ira.weiny at intel.com>Reviewed-by John Hubbard <jhubbard at nvidia.com>Reviewed-by William Kucharski <william.kucharski at oracle.com>Signed-off-by Bharath Vedartham <linux.bhar at gmail.com>--- drivers/misc/sgi-gru/grufault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/sgi-gru/grufault.c +1
-1@@ -188,7 +188,7 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma,if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page); -put_page (page); +put_user_page (page);return 0 ; }Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH 2/2] sgi-gru: Remove uneccessary ifdef for CONFIG_HUGETLB_PAGE
In reply to Dimitri SivanichQuoted 1 line · Dimitri Sivanich
Reviewed-by Dimitri Sivanich <sivanich at hpe.com>
Thanks!
Quoted 65 lines · Bharath Vedartham
Quoted 64 lines
is_vm_hugetlb_pagewill always return false ifCONFIG_HUGETLB_PAGEis not set.Cc Ira Weiny <ira.weiny at intel.com>Cc John Hubbard <jhubbard at nvidia.com>Cc J?r?me Glisse <jglisse at redhat.com>Cc Greg Kroah-Hartman <gregkh at linuxfoundation.org>Cc Dimitri Sivanich <sivanich at sgi.com>Cc Arnd Bergmann <arnd at arndb.de>Cc William Kucharski <william.kucharski at oracle.com>Cc Christoph Hellwig <hch at lst.de>Cc linux-kernel at vger.kernel.orgCc linux-mm at kvack.orgCc linux-kernel-mentees at lists.linuxfoundation.orgReviewed-by Ira Weiny <ira.weiny at intel.com>Reviewed-by John Hubbard <jhubbard at nvidia.com>Reviewed-by William Kucharski <william.kucharski at oracle.com>Signed-off-by Bharath Vedartham <linux.bhar at gmail.com>--- drivers/misc/sgi-gru/grufault.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/misc/sgi-gru/grufault.c +11
-10@@ -180,11 +180,11 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma, {struct page *page; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +if (get_user_pages (vaddr,1 , write ?FOLL_WRITE :0 , &page,NULL ) <=0 )return -EFAULT ; *paddr =page_to_phys (page);@@ -238,11 +238,12 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,return 1 ; *paddr =pte_pfn (pte) <<PAGE_SHIFT ; -#ifdef CONFIG_HUGETLB_PAGE - *pageshift =is_vm_hugetlb_page (vma) ?HPAGE_SHIFT :PAGE_SHIFT ; -#else - *pageshift =PAGE_SHIFT ; -#endif + +if (unlikely (is_vm_hugetlb_page (vma))) + *pageshift =HPAGE_SHIFT ; +else + *pageshift =PAGE_SHIFT ; +return 0 ; err:Signature · 1 line
2.7.4
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
In reply to Bharath VedarthamQuoted 7 lines · Bharath Vedartham
Quoted 1 line · Dimitri Sivanich
Reviewed-by Dimitri Sivanich <sivanich at hpe.com>Thanks!
John, would you like to take this patch into your miscellaneous conversions patch set?
(+Andrew and Michal, so they know where all this is going.)
Sure, although that conversion series [1] is on a brief hold, because there are additional conversions desired, and the API is still under discussion. Also, reading between the lines of Michal's response [2] about it, I think people would prefer that the next revision include the following, for each conversion site:
Conversion of gup/put_page sites:
Before:
get_user_pages(...); ... for each page: put_page();
After:
gup_flags |= FOLL_PIN; (maybe FOLL_LONGTERM in some cases) vaddr_pin_user_pages(...gup_flags...) ... vaddr_unpin_user_pages(); /* which invokes put_user_page() */
Fortunately, it's not harmful for the simpler conversion from put_page() to put_user_page() to happen first, and in fact those have usually led to simplifications, paving the way to make it easier to call vaddr_unpin_user_pages(), once it's ready. (And showing exactly what to convert, too.)
So for now, I'm going to just build on top of Ira's tree, and once the vaddr*() API settles down, I'll send out an updated series that attempts to include the reviews and ACKs so far (I'll have to review them, but make a note that review or ACK was done for part of the conversion), and adds the additional gup(FOLL_PIN), and uses vaddr*() wrappers instead of gup/pup.
[1] https://lore.kernel.org/r/20190807013340.9706-1-jhubbard at nvidia.com
[2] https://lore.kernel.org/r/20190809175210.GR18351 at dhcp22.suse.cz
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
Quoted 26 lines · John Hubbard
Quoted 7 lines · Bharath Vedartham
Quoted 1 line · Dimitri Sivanich
Reviewed-by Dimitri Sivanich <sivanich at hpe.com>Thanks!
John, would you like to take this patch into your miscellaneous conversions patch set?
(+Andrew and Michal, so they know where all this is going.)
Sure, although that conversion series [1] is on a brief hold, because there are additional conversions desired, and the API is still under discussion. Also, reading between the lines of Michal's response [2] about it, I think people would prefer that the next revision include the following, for each conversion site:
Conversion of gup/put_page sites:
Before:
get_user_pages(...); ... for each page: put_page();
Quoted 4 lines
After:
gup_flags |= FOLL_PIN; (maybe FOLL_LONGTERM in some cases) vaddr_pin_user_pages(...gup_flags...)
I was hoping that FOLL_PIN would be handled by vaddr_pin_user_pages.
Quoted 8 lines
... vaddr_unpin_user_pages(); /* which invokes put_user_page() */Fortunately, it's not harmful for the simpler conversion from
put_page()toput_user_page()to happen first, and in fact those have usually led to simplifications, paving the way to make it easier to callvaddr_unpin_user_pages(), once it's ready. (And showing exactly what to convert, too.)
If that makes the later conversion easier then no real objections from me. Assuming that the current put_user_page conversions are correct of course (I have the mlock one and potentials that falls into the same category in mind).
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
In reply to John HubbardQuoted 46 lines · John Hubbard
Quoted 7 lines · Bharath Vedartham
Quoted 1 line · Dimitri Sivanich
Reviewed-by Dimitri Sivanich <sivanich at hpe.com>Thanks!
John, would you like to take this patch into your miscellaneous conversions patch set?
(+Andrew and Michal, so they know where all this is going.)
Sure, although that conversion series [1] is on a brief hold, because there are additional conversions desired, and the API is still under discussion. Also, reading between the lines of Michal's response [2] about it, I think people would prefer that the next revision include the following, for each conversion site:
Conversion of gup/put_page sites:
Before:
get_user_pages(...); ... for each page: put_page();After:
gup_flags |= FOLL_PIN; (maybe FOLL_LONGTERM in some cases) vaddr_pin_user_pages(...gup_flags...) ... vaddr_unpin_user_pages(); /* which invokes put_user_page() */Fortunately, it's not harmful for the simpler conversion from
put_page()toput_user_page()to happen first, and in fact those have usually led to simplifications, paving the way to make it easier to callvaddr_unpin_user_pages(), once it's ready. (And showing exactly what to convert, too.)So for now, I'm going to just build on top of Ira's tree, and once the vaddr*() API settles down, I'll send out an updated series that attempts to include the reviews and ACKs so far (I'll have to review them, but make a note that review or ACK was done for part of the conversion), and adds the additional
gup(FOLL_PIN), and uses vaddr*() wrappers instead of gup/pup.
Quoted 4 lines
[1] https://lore.kernel.org/r/20190807013340.9706-1-jhubbard at nvidia.com
[2] https://lore.kernel.org/r/20190809175210.GR18351 at dhcp22.suse.cz
Cc' lkml(I missed out the 'l' in this series).
sounds good. It makes sense to keep the entire gup in the kernel rather than to expose it outside.
I ll make sure to checkout the emails on vaddr*() API and pace my work on it accordingly.
Thank you
Bharath
Quoted 4 lines
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Re: [Linux-kernel-mentees][PATCH v6 1/2] sgi-gru: Convert put_page() to put_user_page*()
In reply to Michal HockoQuoted 3 lines · Michal Hocko
Quoted 2 lines · John Hubbard
Quoted 1 line · Bharath Vedartham
On Mon, Aug 19, 2019 at 07:56:11AM -0500, Dimitri Sivanich wrote:
...
Quoted 9 lines
Quoted 9 lines
Conversion of gup/put_page sites:
Before:
get_user_pages(...); ... for each page: put_page();
Quoted 7 lines
Quoted 4 lines
After:
gup_flags |= FOLL_PIN; (maybe FOLL_LONGTERM in some cases) vaddr_pin_user_pages(...gup_flags...)I was hoping that
FOLL_PINwould be handled byvaddr_pin_user_pages.
Good point: now that we've got the 4 cases summarized, it turns out that either FOLL_PIN is required, or there is no need to call vaddr_pin_user_pages() at all. So we can go back to setting FOLL_PIN inside it, which is of course much better for maintenance. Great!
Quoted 9 lines
Quoted 8 lines
... vaddr_unpin_user_pages(); /* which invokes put_user_page() */Fortunately, it's not harmful for the simpler conversion from
put_page()toput_user_page()to happen first, and in fact those have usually led to simplifications, paving the way to make it easier to callvaddr_unpin_user_pages(), once it's ready. (And showing exactly what to convert, too.)
Quoted 5 lines
If that makes the later conversion easier then no real objections from me. Assuming that the current
put_user_pageconversions are correct of course (I have the mlock one and potentials that falls into the same category in mind).
Agreed: only correct conversions should be done. Not the incorrect ones. ahem. :)
thanks,
Signature · 2 lines
John Hubbard NVIDIA