From: Jan Kara Subject: Re: [PATCH v4 01/23] mm/gup: pass flags arg to __gup_device_* functions Date: Wed, 13 Nov 2019 11:50:51 +0100 Message-ID: <20191113105051.GH6367@quack2.suse.cz> References: <20191113042710.3997854-1-jhubbard@nvidia.com> <20191113042710.3997854-2-jhubbard@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20191113042710.3997854-2-jhubbard@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org To: John Hubbard Cc: Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jason Gunthorpe , Jens Axboe , Jonathan Corbet , =?iso-8859-1?B?Suly9G1l?= Glisse , Magnus Karlsson , Mauro Carvalho Chehab , Micha List-Id: dri-devel@lists.freedesktop.org On Tue 12-11-19 20:26:48, John Hubbard wrote: > A subsequent patch requires access to gup flags, so > pass the flags argument through to the __gup_device_* > functions. > > Also placate checkpatch.pl by shortening a nearby line. > > Reviewed-by: Jérôme Glisse > Reviewed-by: Ira Weiny > Cc: Kirill A. Shutemov > Signed-off-by: John Hubbard Looks good! You can add: Reviewed-by: Jan Kara Honza > --- > mm/gup.c | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) > > diff --git a/mm/gup.c b/mm/gup.c > index 8f236a335ae9..85caf76b3012 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -1890,7 +1890,8 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end, > > #if defined(CONFIG_ARCH_HAS_PTE_DEVMAP) && defined(CONFIG_TRANSPARENT_HUGEPAGE) > static int __gup_device_huge(unsigned long pfn, unsigned long addr, > - unsigned long end, struct page **pages, int *nr) > + unsigned long end, unsigned int flags, > + struct page **pages, int *nr) > { > int nr_start = *nr; > struct dev_pagemap *pgmap = NULL; > @@ -1916,13 +1917,14 @@ static int __gup_device_huge(unsigned long pfn, unsigned long addr, > } > > static int __gup_device_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > - unsigned long end, struct page **pages, int *nr) > + unsigned long end, unsigned int flags, > + struct page **pages, int *nr) > { > unsigned long fault_pfn; > int nr_start = *nr; > > fault_pfn = pmd_pfn(orig) + ((addr & ~PMD_MASK) >> PAGE_SHIFT); > - if (!__gup_device_huge(fault_pfn, addr, end, pages, nr)) > + if (!__gup_device_huge(fault_pfn, addr, end, flags, pages, nr)) > return 0; > > if (unlikely(pmd_val(orig) != pmd_val(*pmdp))) { > @@ -1933,13 +1935,14 @@ static int __gup_device_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > } > > static int __gup_device_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr, > - unsigned long end, struct page **pages, int *nr) > + unsigned long end, unsigned int flags, > + struct page **pages, int *nr) > { > unsigned long fault_pfn; > int nr_start = *nr; > > fault_pfn = pud_pfn(orig) + ((addr & ~PUD_MASK) >> PAGE_SHIFT); > - if (!__gup_device_huge(fault_pfn, addr, end, pages, nr)) > + if (!__gup_device_huge(fault_pfn, addr, end, flags, pages, nr)) > return 0; > > if (unlikely(pud_val(orig) != pud_val(*pudp))) { > @@ -1950,14 +1953,16 @@ static int __gup_device_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr, > } > #else > static int __gup_device_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > - unsigned long end, struct page **pages, int *nr) > + unsigned long end, unsigned int flags, > + struct page **pages, int *nr) > { > BUILD_BUG(); > return 0; > } > > static int __gup_device_huge_pud(pud_t pud, pud_t *pudp, unsigned long addr, > - unsigned long end, struct page **pages, int *nr) > + unsigned long end, unsigned int flags, > + struct page **pages, int *nr) > { > BUILD_BUG(); > return 0; > @@ -2062,7 +2067,8 @@ static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > if (pmd_devmap(orig)) { > if (unlikely(flags & FOLL_LONGTERM)) > return 0; > - return __gup_device_huge_pmd(orig, pmdp, addr, end, pages, nr); > + return __gup_device_huge_pmd(orig, pmdp, addr, end, flags, > + pages, nr); > } > > refs = 0; > @@ -2092,7 +2098,8 @@ static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > } > > static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr, > - unsigned long end, unsigned int flags, struct page **pages, int *nr) > + unsigned long end, unsigned int flags, > + struct page **pages, int *nr) > { > struct page *head, *page; > int refs; > @@ -2103,7 +2110,8 @@ static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr, > if (pud_devmap(orig)) { > if (unlikely(flags & FOLL_LONGTERM)) > return 0; > - return __gup_device_huge_pud(orig, pudp, addr, end, pages, nr); > + return __gup_device_huge_pud(orig, pudp, addr, end, flags, > + pages, nr); > } > > refs = 0; > -- > 2.24.0 > -- Jan Kara SUSE Labs, CR