From patchwork Thu Jun 13 10:53:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13696639 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 4CE5FC27C79 for ; Thu, 13 Jun 2024 10:54:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E98F26B0096; Thu, 13 Jun 2024 06:53:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E46836B0098; Thu, 13 Jun 2024 06:53:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D357C6B0099; Thu, 13 Jun 2024 06:53:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B4A0B6B0096 for ; Thu, 13 Jun 2024 06:53:59 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 401981219C1 for ; Thu, 13 Jun 2024 10:53:59 +0000 (UTC) X-FDA: 82225555398.06.442F5D4 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf29.hostedemail.com (Postfix) with ESMTP id CD2B0120010 for ; Thu, 13 Jun 2024 10:53:56 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1718276037; 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=h0S7yF7wpzrUoqotOipq3SjDSseA96EwUGD4qDVkMmk=; b=MC2/46eIYe59XLI7+ewvesLH1faB+AbvFF1FimJ51cNqDCpS6PU4Z1fSTiR/WHED3z7jwi stDpDyx4YPlVNwKLFMOPYtMwiZ1FoqqNQVPrW4eSgGTHrW4F2UNMJs/9s+VwxQX/S1mh23 RsK+l+hHNgZ9oRNTTr3+JLACUjuVHS0= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1718276037; a=rsa-sha256; cv=none; b=rQ8OEBeRa3atYHFGhg0yoPHngbcHoRpY3wGqSoBeW8RJPCZl8jWcY9/w3wEdSGFuoP1gwE mtuW53Q2+jWNbxUMTwPsXmO1tD7+m6vM1EZATimyaWEPb4NQxaEwMKzYWMH+pqE9yrGzzu TRRlC7voo3SshbckH2K6jZkobQiDzpk= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4W0K145mB4zwSPy; Thu, 13 Jun 2024 18:49:44 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id F15641402CA; Thu, 13 Jun 2024 18:53:51 +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; Thu, 13 Jun 2024 18:53:51 +0800 From: Kefeng Wang To: Andrew Morton CC: Muchun Song , "Matthew Wilcox (Oracle)" , David Hildenbrand , , Kefeng Wang Subject: [PATCH 2/2] mm: memory: use folio in struct copy_subpage_arg Date: Thu, 13 Jun 2024 18:53:44 +0800 Message-ID: <20240613105344.2876119-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240613105344.2876119-1-wangkefeng.wang@huawei.com> References: <20240613105344.2876119-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: CD2B0120010 X-Stat-Signature: ek5rwgd1sdmocrtt4bw7fjahbjaa18sy X-HE-Tag: 1718276036-685414 X-HE-Meta: U2FsdGVkX1/lPESAvjRMCBVgo9SzrDu6osSK79WsbqGVOPYVjiWn3iUQrN9omFywTMBeU/KEhRPh48SGl6ZYn5V6GdGxvsnVj03+Y7xRwD6OFb8GxD0taGCZnvQKOAuiAg4tOR/QR0qeWdh37C3KTS2Pax1CGc866iNyxnnoSOkbz6GVtIH+nEGKus+LjKURhOAT9MnWrEhMGlHyLKzxcZZJpTCig4sumQzStu3q/4iM1ZS8e71wC52zss+hpOluVK4chXCkav8eWV0Si6sJz29bb8e0lDpasObLTh1PSZgS+vSioRuRGY06gsTLfi6AduYo5QPpdr5KImtzVBP9K3mnkgB7d1dAaU3Y//nSg6oiZy3bhkaveWBpCy0up0LLo3KyBeWkT6q0wnNsyT6ascGXtcgn3h2kTyxQv2tWqi0Szh6qgvP8BtvNWGzoc/CVx/UbHxMv0LaSRX08YBt+PqCgz/UftAYUtsFkebPw5oWLdWmWZcviMS2OvDHNIzMCU8szcvbZZ0rkYro91h4oT2VjEHnY2ETYrx3BDYCO5FQnxKRVfBEbE964TKA5+BwqJFSyC6cVh/ioLCPLgRa7OUXrBEUISfHqLyA5SJymNyi68+UXw9wkO89GDBCtjEQ2Ctt1GPw9YPKrQB1hXrpp6iotoVh7lGSom4+gpDEkoZ6MAUFPWw5vq/PnsQEb9rMBarmse7Uj1bJLQYX6B/d+0Q04vV2BNtwBifquEWVBPDShNEs4JG7tIMqXLCREiqzE62iBKqrVBfvXzV1tn52YCm/xeMjAMoIqOOnF97Us4InQkmcnDW/uZqyM4HhKPY/XPxlZWoJw4lpbzv3EeCTStmlkR+T/BSbpv0SeQbf7JeGRfoWdwUJWIcS3Vl41K+djEd5Qd43aUyjedmwyXQn2cEu2k68kKLHGGCy7ddY/+wFHbCgMeOHTmnbEw7bmUSvtKy2Vt1pY9rvmt2B7WtQ tJ0XXAHQ cyz0pvyzNg1IOqxlVBl0y9ydDl8JMLkgzNkRCTHmZCZV5E3h3Rj8p1VcSEWkq7i3wLE7FmmULyPNbcsMyTpymBkiI2Kk2r7DAKOKNvwfpPf5eB9DYjKpXl17aSu7U4Ql1XWCkTDangsWSOB0VYyLUpbhJZnPoUsPF/+XYaEAXL/O4VRfwOt6YIdRt9a/Q1JR94Mqg 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. Signed-off-by: Kefeng Wang Acked-by: David Hildenbrand --- mm/memory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 6ef84cd0b2bf..ca44da80fd47 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6475,16 +6475,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; @@ -6498,8 +6498,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, };