Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4284934ybv; Mon, 10 Feb 2020 16:17:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxynZsOglln/FfYZdlP7GdUMZA0PQlDVa6k043fhcS+4akDb4mJu5WNolicanZMloT5MDlk X-Received: by 2002:aca:cdd0:: with SMTP id d199mr1205312oig.49.1581380272942; Mon, 10 Feb 2020 16:17:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581380272; cv=none; d=google.com; s=arc-20160816; b=TEFRA9fmL7lYSt2KnQ7u6RegqiDHdBeo5/i8XfC+sbd/G0aE1oF3hPqNcWRiWgoWdn Gs6PAfBnErPmGDWQuXm7MVu1LAuABPJbv/Ec/51KVgoNGEukay7sAtwI7ZSsVrB+imgQ 5Zi4oZHkk4OoIisY7Vs7kp2eG0u9w0PHtfC9uhFjlG2v/4Q8Cpd/EztgfUGOAZcPAKr+ TPkZIX//WSJBp05DVvZqzPUhp1amFUyUqHe7v5s3O2fNdDmM8XK/WRvUTYs2ooDyDfKe qTyJrlNMpXthWwWtCN8pkkOHAfIwRZ8D98jVuTZyia2YYJuVL7OCYOnSCc0xayXMMpEA InXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=+TuU8OOcGV+ejGVFCndVV6S1iiJ5m64AX+o6oBv/wIw=; b=SJkmtvUUds5BsQfpMJDnDkN2PHjVdb9APBQUWOnRUJ1k6Ei+WSA9r5ux9hqA2t7IA4 L7T+XM4DR/+RcihIcriqMMVdohb3Lezzb6thAjh0DLfBedVbSvHWZDEM3qh3Zzj4Ams7 VOzuwJ6/jxhdV+6VPmEYp7dm7lujdnd66H1fFV85ksHohNsLZcs/xnMtxnuQiNvFnPMw FyYgSnmWGxMEPpgTFGvsF5RtmrLTs/e6NQzNQxV24XYnsuiGMxztQ/nN/sT9E+Oy+k35 8OT6JD6tGHJAV0y6TIRq23zCbaao2AvvW5ynP09zIpzEM8ST5BrSQrvHjbFqMongNtX4 tKXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rySPtA4z; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c144si936991oig.263.2020.02.10.16.17.41; Mon, 10 Feb 2020 16:17:52 -0800 (PST) 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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rySPtA4z; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbgBKAQq (ORCPT + 99 others); Mon, 10 Feb 2020 19:16:46 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:4094 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbgBKAPj (ORCPT ); Mon, 10 Feb 2020 19:15:39 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 10 Feb 2020 16:15:24 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Mon, 10 Feb 2020 16:15:38 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 10 Feb 2020 16:15:38 -0800 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 11 Feb 2020 00:15:38 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 11 Feb 2020 00:15:38 +0000 Received: from blueforge.nvidia.com (Not Verified[10.110.48.28]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 10 Feb 2020 16:15:37 -0800 From: John Hubbard To: Andrew Morton CC: Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jan Kara , Jason Gunthorpe , Jonathan Corbet , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , "Kirill A . Shutemov" , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , , , , , , LKML , John Hubbard , "Kirill A . Shutemov" Subject: [PATCH v6 04/12] mm/gup: pass gup flags to two more routines Date: Mon, 10 Feb 2020 16:15:28 -0800 Message-ID: <20200211001536.1027652-5-jhubbard@nvidia.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200211001536.1027652-1-jhubbard@nvidia.com> References: <20200211001536.1027652-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1581380124; bh=+TuU8OOcGV+ejGVFCndVV6S1iiJ5m64AX+o6oBv/wIw=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=rySPtA4zcKWR2BPaJ1IGD9md45eWG7WC2cKh9eXWjeSedfKMRbY0Hf+B3ww70efW2 L1B+qvrClsrexNdyrUb4ZLBBmm0VsLe/yO8kxyHyZdurqSBq4MxzWQSHw7q++mct+x epeGRxVrR/lc8kuOLN+d3QykjTfTTeJXFf+0OoyBJzrLMZUVWUJArw6162d24j5HVy /YkbC+F30V9queEmJS4N4KKw/46V00f7iVD+mAIPS9Jb8H3NjW8uMydEG1CO4VQRzR VVLd+0sQ3GAA0kO60CvdELFtGAlxhASpgdQF+JKL4+hirllcR7HNsK6X/Z3FA25SJe W+KLCmFkqijgg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for an upcoming patch, send gup flags args to two more routines: put_compound_head(), and undo_dev_pagemap(). Acked-by: Kirill A. Shutemov Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- mm/gup.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 9e117998274c..e5f75e886663 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 */ =20 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 add= r, unsigned long end, =20 pgmap =3D 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, unsig= ned long addr, =20 pgmap =3D 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 *p= mdp, unsigned long addr, return 0; =20 if (unlikely(pmd_val(orig) !=3D 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 *p= udp, unsigned long addr, return 0; =20 if (unlikely(pud_val(orig) !=3D 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, unsigne= d long addr, return nr; } =20 -static void put_compound_head(struct page *page, int refs) +static void put_compound_head(struct page *page, int refs, unsigned int fl= ags) { 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; =20 if (unlikely(pte_val(pte) !=3D pte_val(*ptep))) { - put_compound_head(head, refs); + put_compound_head(head, refs, flags); return 0; } =20 @@ -2163,7 +2164,7 @@ static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsi= gned long addr, return 0; =20 if (unlikely(pmd_val(orig) !=3D pmd_val(*pmdp))) { - put_compound_head(head, refs); + put_compound_head(head, refs, flags); return 0; } =20 @@ -2197,7 +2198,7 @@ static int gup_huge_pud(pud_t orig, pud_t *pudp, unsi= gned long addr, return 0; =20 if (unlikely(pud_val(orig) !=3D pud_val(*pudp))) { - put_compound_head(head, refs); + put_compound_head(head, refs, flags); return 0; } =20 @@ -2226,7 +2227,7 @@ static int gup_huge_pgd(pgd_t orig, pgd_t *pgdp, unsi= gned long addr, return 0; =20 if (unlikely(pgd_val(orig) !=3D pgd_val(*pgdp))) { - put_compound_head(head, refs); + put_compound_head(head, refs, flags); return 0; } =20 --=20 2.25.0