Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp26090ybv; Tue, 4 Feb 2020 15:43:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyQNBpsn1FH5Z3Z2muP1GC4ndAUYOx/jMTnpwYW/HT77RgvLpG/2chj8l0ETs5WzUvpsOk0 X-Received: by 2002:aca:54cc:: with SMTP id i195mr1039265oib.126.1580859794137; Tue, 04 Feb 2020 15:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580859794; cv=none; d=google.com; s=arc-20160816; b=d81XDx+XHGB0UZwKKwRYTnRn06J05XbeMoQ5OS0OHgsOX6hcs+ufzmkpgysupfDSMS 26C2+nXCGbYeMFNDtGkEQh0cewi+ggkhCfamXM8KXaolOEBqz4ze3Lq15zmXwOQtIoyw q+7fPbphxsuKLa2pZ0rCawiJuVHugyRsp294K+HAMvSHdg4KcJizBT0KMd07EC4XT9+S 9l0/n3u4VbxA2eSCZlF/uuwd3ab8kb1fZJxgEiOKjuo0ZDcKCgBY95IH9ysHUZrO0mzN LzaHINeEruLD03xfr7Hsmp2W25XjljHT9C/9pHRJutmHfA6Vop3Fq4Z+moLXMC1mHQEx 52wA== 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=ANhtOBUHyRLQNX5rJqzXPry/Et/svjKEsNYd1C0RWL4cjmdJi04vTdQRn2alonDtLl KTeFa9fRMkAUVwi9TMeBhbE+Qi9aal15Xiszg3BLX1G21bN4NKoG9cEhSjgRdMiGfvem K8/NyD+yaKP+tZCnhR5fcto7jo5tMxhBgO3zk26u5CALmVPmcNJAZhmvVhi2Y+nMNBnH 8DVvE7UDQyybl0tnjbuEF2p0bCJ83x4J3/QRoqkSx+APs6ky5HtXsnm52+InC46C2pJf iiD6P5v9xgTa5YTLk5CfMMOg4uY/dT+loxj52pvSlQ2hS7g8iJJmCSy0xTKbEnmvhw/0 cJ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Q0MqrWea; 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 j15si6470513oii.163.2020.02.04.15.43.02; Tue, 04 Feb 2020 15:43:14 -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=Q0MqrWea; 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 S1727769AbgBDXlY (ORCPT + 99 others); Tue, 4 Feb 2020 18:41:24 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:8800 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbgBDXlX (ORCPT ); Tue, 4 Feb 2020 18:41:23 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 04 Feb 2020 15:40:57 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 04 Feb 2020 15:41:20 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 04 Feb 2020 15:41:20 -0800 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 4 Feb 2020 23:41:20 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 4 Feb 2020 23:41:19 +0000 Received: from blueforge.nvidia.com (Not Verified[10.110.48.28]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 04 Feb 2020 15:41:19 -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 v4 05/12] mm/gup: pass gup flags to two more routines Date: Tue, 4 Feb 2020 15:41:10 -0800 Message-ID: <20200204234117.2974687-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200204234117.2974687-1-jhubbard@nvidia.com> References: <20200204234117.2974687-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=1580859657; 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=Q0MqrWea83wAxu1ZNY+WHmXWt/4w/RAbKVO9o/cqcMcUYoi5BgNuFuQRyQk+2+fog eED7EvSbLuGqCkkQyhyp93fhTLAR+OMiRWxtVD7bFmhAxsKzWTOr90Im9NvLvTW09g Fk5P1gKwHWq2CL4N6O7Fx9B/bhMtD+IX2n+O8XLxTKlVJRUnjT30KI8ToByaHIfZM+ l4fGE1K250JLJge3ywRfomZwYGhe8Sn7IL+TuYwtiP/WmPMxWzwPBEiXBmtdJTRqKl sDPfPrrCeN/9iFgnyejlPNAp/Y65vDJCY4MZ9Lhqi5lcUyPSLJ7A9XExDEAkXFuMXZ 0oRkyxsXnwyGQ== 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