From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3F13C33CAC for ; Mon, 3 Feb 2020 14:18:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B0F542086A for ; Mon, 3 Feb 2020 14:18:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0F542086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 625AD6B0666; Mon, 3 Feb 2020 09:18:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D6B46B0667; Mon, 3 Feb 2020 09:18:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 513C36B0668; Mon, 3 Feb 2020 09:18:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 3C32B6B0666 for ; Mon, 3 Feb 2020 09:18:59 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id ED6B382499B9 for ; Mon, 3 Feb 2020 14:18:58 +0000 (UTC) X-FDA: 76449022356.28.humor95_4e5ea704f4e2d X-HE-Tag: humor95_4e5ea704f4e2d X-Filterd-Recvd-Size: 5502 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 3 Feb 2020 14:18:58 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 92FE4AFE8; Mon, 3 Feb 2020 14:18:56 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 469811E0D69; Mon, 3 Feb 2020 15:18:56 +0100 (CET) Date: Mon, 3 Feb 2020 15:18:56 +0100 From: Jan Kara To: John Hubbard Cc: Andrew Morton , Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jan Kara , Jason Gunthorpe , Jonathan Corbet , =?iso-8859-1?B?Suly9G1l?= Glisse , "Kirill A . Shutemov" , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v3 05/12] mm/gup: pass gup flags to two more routines Message-ID: <20200203141856.GC18591@quack2.suse.cz> References: <20200201034029.4063170-1-jhubbard@nvidia.com> <20200201034029.4063170-6-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200201034029.4063170-6-jhubbard@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri 31-01-20 19:40:22, John Hubbard wrote: > In preparation for an upcoming patch, send gup flags args to two more > routines: put_compound_head(), and undo_dev_pagemap(). > > Signed-off-by: John Hubbard Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > mm/gup.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/mm/gup.c b/mm/gup.c > index 65a40560c8d0..83473c2165f4 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -1870,6 +1870,7 @@ static inline pte_t gup_get_pte(pte_t *ptep) > #endif /* CONFIG_GUP_GET_PTE_LOW_HIGH */ > > static void __maybe_unused undo_dev_pagemap(int *nr, int nr_start, > + unsigned int flags, > struct page **pages) > { > while ((*nr) - nr_start) { > @@ -1909,7 +1910,7 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end, > > pgmap = get_dev_pagemap(pte_pfn(pte), pgmap); > if (unlikely(!pgmap)) { > - undo_dev_pagemap(nr, nr_start, pages); > + undo_dev_pagemap(nr, nr_start, flags, pages); > goto pte_unmap; > } > } else if (pte_special(pte)) > @@ -1974,7 +1975,7 @@ static int __gup_device_huge(unsigned long pfn, unsigned long addr, > > pgmap = get_dev_pagemap(pfn, pgmap); > if (unlikely(!pgmap)) { > - undo_dev_pagemap(nr, nr_start, pages); > + undo_dev_pagemap(nr, nr_start, flags, pages); > return 0; > } > SetPageReferenced(page); > @@ -2001,7 +2002,7 @@ static int __gup_device_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > return 0; > > if (unlikely(pmd_val(orig) != pmd_val(*pmdp))) { > - undo_dev_pagemap(nr, nr_start, pages); > + undo_dev_pagemap(nr, nr_start, flags, pages); > return 0; > } > return 1; > @@ -2019,7 +2020,7 @@ static int __gup_device_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr, > return 0; > > if (unlikely(pud_val(orig) != pud_val(*pudp))) { > - undo_dev_pagemap(nr, nr_start, pages); > + undo_dev_pagemap(nr, nr_start, flags, pages); > return 0; > } > return 1; > @@ -2053,7 +2054,7 @@ static int record_subpages(struct page *page, unsigned long addr, > return nr; > } > > -static void put_compound_head(struct page *page, int refs) > +static void put_compound_head(struct page *page, int refs, unsigned int flags) > { > VM_BUG_ON_PAGE(page_ref_count(page) < refs, page); > /* > @@ -2103,7 +2104,7 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, > return 0; > > if (unlikely(pte_val(pte) != pte_val(*ptep))) { > - put_compound_head(head, refs); > + put_compound_head(head, refs, flags); > return 0; > } > > @@ -2163,7 +2164,7 @@ static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, > return 0; > > if (unlikely(pmd_val(orig) != pmd_val(*pmdp))) { > - put_compound_head(head, refs); > + put_compound_head(head, refs, flags); > return 0; > } > > @@ -2197,7 +2198,7 @@ static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr, > return 0; > > if (unlikely(pud_val(orig) != pud_val(*pudp))) { > - put_compound_head(head, refs); > + put_compound_head(head, refs, flags); > return 0; > } > > @@ -2226,7 +2227,7 @@ static int gup_huge_pgd(pgd_t orig, pgd_t *pgdp, unsigned long addr, > return 0; > > if (unlikely(pgd_val(orig) != pgd_val(*pgdp))) { > - put_compound_head(head, refs); > + put_compound_head(head, refs, flags); > return 0; > } > > -- > 2.25.0 > -- Jan Kara SUSE Labs, CR