From patchwork Tue Jun 18 09:12:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13702001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0CB6C2BA15 for ; Tue, 18 Jun 2024 09:13:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B80B8D0022; Tue, 18 Jun 2024 05:13:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A4A68D001F; Tue, 18 Jun 2024 05:13:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C89B08D0020; Tue, 18 Jun 2024 05:13:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8B7948D0022 for ; Tue, 18 Jun 2024 05:13:14 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E2564140627 for ; Tue, 18 Jun 2024 09:13:13 +0000 (UTC) X-FDA: 82243445466.27.4C3E66D Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf10.hostedemail.com (Postfix) with ESMTP id 773C8C000B for ; Tue, 18 Jun 2024 09:13:11 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718701989; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=47pB7SRGf5FzTbu0P5M0rb8nOT0uxMIvqdM4ZBeP3fU=; b=IOIajcWB8gNUGSy7aZdXpZJ/0lIRRbkN+QgrE7xaTD6XzApq5qVD5VHq69ZnkL9StCQnuf fNDFuQYQ7tnlTD/aRb4CWoRf4YJow3ZKrnJNIRLgFARj2QrY+zDOhs1Y6rJSwwHpunYzSk G3E08Qz0YK7TQST3XL3DRiws5WnQWMw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718701989; a=rsa-sha256; cv=none; b=gnsBPuoBTcQUqy0aAoCI+5UbkYTS0SP4EEIGoAynJeejhdXKI/wulZyD1Z6Nf27fiDp2kI z/V7R6VhDiKbgr/lOKHbjxNwMytJ56U0+W11xyALK1G3Y/5DomYu632FtlzezAWh0DJame zpaGnROPRZbTOiKuAWphc2/JJtYrLYI= Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4W3LXp6pk7z1j5SP; Tue, 18 Jun 2024 17:09:14 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 9ADF21A016C; Tue, 18 Jun 2024 17:13:07 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 18 Jun 2024 17:13:07 +0800 From: Kefeng Wang To: Andrew Morton CC: Muchun Song , "Matthew Wilcox (Oracle)" , David Hildenbrand , , Huang Ying , Kefeng Wang Subject: [PATCH v2 2/4] mm: memory: use folio in struct copy_subpage_arg Date: Tue, 18 Jun 2024 17:12:40 +0800 Message-ID: <20240618091242.2140164-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240618091242.2140164-1-wangkefeng.wang@huawei.com> References: <20240618091242.2140164-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 773C8C000B X-Stat-Signature: 9yna3ajqipdh5auhxix941n7fck6du61 X-HE-Tag: 1718701991-71839 X-HE-Meta: U2FsdGVkX1+S0oZtRldP37rl5A4Jh+vzoK3hNWPf7wTO1u451XgeOTXKtxppieb7Iish4hFt01eSIvCwBoM/Aq4kS3E5/ro+pSIx+RSZd/TklDSyCq3ceJ8U2gJtcOZRVGQvlwk0U+VrLGYkR1Mc7EJItDMmUOUUFQzgg16l7tv9Dk+gB5aU4/10Z3xmrSKJNkPzmbPk3VhFd4wT+ZZcCsKNFbuYPTuoSm3fwJsFlMH7LDn3yWRXzQ2saaRdwdp1yqkXLbDDxy7GPG2aM4EQH5NW0hurWdMvF7tM18NTj+2QUyqb/lakw6HZ4fCx47Og7qmkpbFOr2ZzoDDavwiJMZYDbMJIAkjIR+QfIBUr8pwpVcQIhoeYJiBLDl9UBa4tcpb9QtG35aVlWgJ2VV1lf2jSKtXZWqBkRvKYPVPsYElgla3DnJ2SGkricHwnCf8wULuebtvZx+VzusPK0xeFQEE5Ss7CiIuztwF7t0y9aEvFVN7uPzASzN7xKiNZEzDFQC8ZnAOhTDnFgzmaEG96p4f4adpVCKxgMcaKeQ34Vui5g878JB0dT2/6ZkXy67pBGn7wEQFB06XNdQGX4yyAmcKSivt3copo5Ho+VmfaefomMCp3agmH7Zf4WnDS/RzE2/Wp4ZEFgRMfzNpnQHiMNcSo4FaRnx8uo9lYPcN2FXGfkEt76+xpRvBQemDJEwf2+7RyLTtvNSSti9ldp5tmOzU8LPINLiD7/2DAewCOqjpHJo8Aa9pvIcdjmZ2fAvOYXHdTHqkLL1zJJaozgMmU7BS8w8nr4tZO7gvsxqLuGqlw+7ZJnFbOAAm7vsO7h//cHVaVc+2GOjoMoTKt9l/BdoKBxMHD6Z1FG12Of2ImU4FDnTAoUAy1lFJO/30X1ZnGVKcfDY3ERU+hqGO+u3FCZQnQg1d3rlnM/mS1d71TGh87O7c5wQW4NwyoCSsM0JpMXwBWObBQMc8S6GKLJOR goYZrWXh Z3NzkAf7fpET0CCeWnCqi/6IcLm8HTXaHafD4GffN2mMQiWLU/LEmmFCiNiAQ28uK1ak5IxhT0X60R6it1B3rhZzQtqCY5drl7nzTCMeBAMw6dkqmB+Cpe4qw8j4zYRaDWdUfWWyfTQp83NMlRNzGdP5hffVcH2I2Gc0dVe0z4z2yRaaGh+kTeNyg2+CkxZmW5M0dztCCJQGe7vp3Uz2rUPGseQ== 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: List-Subscribe: List-Unsubscribe: Directly use folio in struct copy_subpage_arg. Acked-by: David Hildenbrand Signed-off-by: Kefeng Wang --- mm/memory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index bc5d446d9174..a48a790a2b5b 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6477,16 +6477,16 @@ static int copy_user_gigantic_page(struct folio *dst, struct folio *src, } struct copy_subpage_arg { - struct page *dst; - struct page *src; + struct folio *dst; + struct folio *src; struct vm_area_struct *vma; }; static int copy_subpage(unsigned long addr, int idx, void *arg) { struct copy_subpage_arg *copy_arg = arg; - struct page *dst = nth_page(copy_arg->dst, idx); - struct page *src = nth_page(copy_arg->src, idx); + struct page *dst = folio_page(copy_arg->dst, idx); + struct page *src = folio_page(copy_arg->src, idx); if (copy_mc_user_highpage(dst, src, addr, copy_arg->vma)) return -EHWPOISON; @@ -6500,8 +6500,8 @@ int copy_user_large_folio(struct folio *dst, struct folio *src, unsigned long addr = addr_hint & ~(((unsigned long)pages_per_huge_page << PAGE_SHIFT) - 1); struct copy_subpage_arg arg = { - .dst = &dst->page, - .src = &src->page, + .dst = dst, + .src = src, .vma = vma, };