Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1491893ybx; Thu, 31 Oct 2019 11:21:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzERAJ+dCgdJLyus6806JkTYM3ZqFKaMJoZDJx/Bw7UHwAU8Cnj7JbSlp6wBJ0i8zEx4iY9 X-Received: by 2002:a17:906:4056:: with SMTP id y22mr5765164ejj.188.1572546119279; Thu, 31 Oct 2019 11:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572546119; cv=none; d=google.com; s=arc-20160816; b=eE7j4ciILbR+VyCYkwr9g+zIyLLWhsdn93xCh+1kgkOnv2Fg7kOPvFyj5LtUi2s0fJ qCe+hlDNiye+ThOAq58ouE8GrQptzHkpfUpF/ID1ZAKNHJc1MLrzLn6DjzgViTdIxelQ t20ir46a83Ptf8XIJZmtZo9gGDp1+6z0o4IZiSu+qkSORmIMJqjvArSIy0u4RkKD9flR Gw6JWVTfA3Mu2/ztTwwFTqHwsi2C9Q8UXsPUieskm0vOvewP2/CI+m+Iv7sv7vSZPJUP MjYbwxZu/45xyJYQPnmdUdASilvZ7J5FAkXLYQlHw31lcpc78G3K1oUspbkdUZrtqtw3 MQ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=D/tdCqwvvHuwmw5BVOezqpHsu56975EzQDQBh/pAPSA=; b=x4dGZbkAdPnzIPVa01K6YK3Ce5TXqnNOiAObxpnuBdDtMwyXJKQYg4V2Kzaz3oEd8g Sag5I1DpckRPLJnUDBNchwMKfZHNOc9vAnEOXejwD68VRhVBtTO8SeQlaueCiCTNgUSd qPt1za/rGJc0Y8nQlO3Cz9r+MUJkTulIVkgmglRfklWFtjluKftc1UOPhtg33kG1hLVa FuNF5inL+T/E6WVr58rurnQGItho/SXPvdK/nOtLrYO+EU2bw9kCWdSxfUaUuMdwM1KV /K2G7si3W6yWmGD82rgHM0WPNIxrBJVRc6FVP2b219Y6YJsQNH87PD/R7V/MEgWFpT87 soEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f37si5075316eda.190.2019.10.31.11.21.35; Thu, 31 Oct 2019 11:21:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729278AbfJaSSt (ORCPT + 99 others); Thu, 31 Oct 2019 14:18:49 -0400 Received: from mga02.intel.com ([134.134.136.20]:23109 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729027AbfJaSSs (ORCPT ); Thu, 31 Oct 2019 14:18:48 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 11:18:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,252,1569308400"; d="scan'208";a="375329849" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga005.jf.intel.com with ESMTP; 31 Oct 2019 11:18:45 -0700 Date: Thu, 31 Oct 2019 11:18:44 -0700 From: Ira Weiny 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" , Jan Kara , Jason Gunthorpe , Jens Axboe , Jonathan Corbet , =?iso-8859-1?B?Suly9G1l?= Glisse , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , bpf@vger.kernel.org, dri-devel@lists.freedesktop.org, kvm@vger.kernel.org, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, linux-rdma@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-mm@kvack.org, LKML , "Kirill A . Shutemov" Subject: Re: [PATCH 01/19] mm/gup: pass flags arg to __gup_device_* functions Message-ID: <20191031181844.GB14771@iweiny-DESK2.sc.intel.com> References: <20191030224930.3990755-1-jhubbard@nvidia.com> <20191030224930.3990755-2-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191030224930.3990755-2-jhubbard@nvidia.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 30, 2019 at 03:49:12PM -0700, 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: Ira Weiny > Cc: Kirill A. Shutemov > Signed-off-by: John Hubbard > --- > 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.23.0 >