From patchwork Thu Jan 11 11:12:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13517217 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 35EA6C47077 for ; Thu, 11 Jan 2024 11:13:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70DAB6B009D; Thu, 11 Jan 2024 06:13:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BCE86B00A0; Thu, 11 Jan 2024 06:13:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 582D36B009F; Thu, 11 Jan 2024 06:13:46 -0500 (EST) 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 2C21B6B009D for ; Thu, 11 Jan 2024 06:13:46 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0CB3BC059E for ; Thu, 11 Jan 2024 11:13:46 +0000 (UTC) X-FDA: 81666770052.07.7DFD120 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf05.hostedemail.com (Postfix) with ESMTP id CB08A10006C for ; Thu, 11 Jan 2024 11:13:38 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704971619; a=rsa-sha256; cv=none; b=atmGdGNXPMF8p/v2YOoqaladLpjhEzdoM6o23h56nb3VbrWWLmyuN+cDnt/JOpMW1Fnb6d sJZdpOTjiOMHA8C1HDg/QgXMvkKdbD/8G2pHf9WLwqGeoN0UvnqEjKUU/wYUonvjYucQTT C3m0ZcMceZxfX9IJsjDqgIx6RjbqIBg= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704971619; 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=RJKWCsjrvrxR0bMzo6GUQfyaGQbwhcyBfRj9xVJyA4U=; b=j4qv09Wr63usZlfNs9GFbkkwR+9qu6JW8gWtbgXHdK4yIrbmtVsuJ64dSst7lknbwdVF1a 9guWBpFGCQr77Tm1B4H1mxZkiMNRbSO2T2l2CzdKRLTJgnjfkUF1K/uVpIwXy3SjqpOyOR oTVpdov1q/huMqvFRDMOntxgnbgROs0= Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4T9hpk0Z0yz1Q7T4; Thu, 11 Jan 2024 19:12:46 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id BE9AF180071; Thu, 11 Jan 2024 19:13:31 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 11 Jan 2024 19:13:31 +0800 From: Kefeng Wang To: Andrew Morton , CC: , , , , Kefeng Wang Subject: [PATCH v2 3/8] mm: huge_memory: use pfn_swap_entry_to_folio() in __split_huge_pmd_locked() Date: Thu, 11 Jan 2024 19:12:34 +0800 Message-ID: <20240111111239.2453282-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240111111239.2453282-1-wangkefeng.wang@huawei.com> References: <20240111111239.2453282-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100001.china.huawei.com (7.185.36.93) X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: CB08A10006C X-Stat-Signature: 1fh8and9yw6a7b1a48bhdzu7nb5jmrws X-Rspam-User: X-HE-Tag: 1704971618-53702 X-HE-Meta: U2FsdGVkX19t0oFeQFu8+L17H3gwVyk4pu+Y/nohwGG/MMw/+C4u04up78XGQIJlFZftW7POlm3njM5flCzt8/Uaw3FqZuY4eECsKc/1R5enhtBk+sB9AF9PuXDhHx/Eo715NkdfMpCG0j/Q44hPJFocwxXzY+aLJ7Z78UNOw2bJ42zDY3BWnH4mUk2jvVfYCLdJ6d0uNSgOBf1K98ptd8yo7geiIVLkpsmE0ExUSP5VNJ7DIBDj9DU4MRr9ah+WH051xKK1iBECRSACbXwcErAVh00gJzchcqeHXlkvqoxym6evLupPLViXipu1k/CZAApNmD4EcGQ5A627//lv9mrRkfrGwg1B+wNuWhmE9Sjsz5XYCK9MC9uGr/qL/aGuF8dCe3mu/0Gz/4qOKr8ge4pxRCuh2defp8timSwhHJrD6mSzLFCtQ0QOZFYSaXLS0CjDdyb4bC3cKtW1YA3S4JH7/pHU7TD3zPE2FtenIXu+qlESrKIerUYEeZYyiy5L0/J59dAi/wobGCQKMugtTKQu96G5LodNrSeBCLb0ihXoV74cGDbr6ZMPrRVH6/1TNBxtsnNyc+tas88OLwDWanBYGiHNTnFgg2caIa37/xFysRBRfd5UL363O7t1sO2TjoHQuNZWjAaXp2AI3Vj4175ePWGrOyiiRRRK11hWYz506UGOssdZFEZjbc9WpmfVlqhaZHbogTiz9O9nHmCnZ/o3XZcPqUN784XYclr2EbeqywFdUzN7RggjqCZEqTAkAjxJzCODSEM7zzHMN+rLqF3XKMaMOfOvyhzDDGDRDEJkUVUMMNjKRHHy73sah6KXukp71tNP0pu6ZBsJ952lr+tZ3Tu8GNdy7DU9ujoeRMTxwcbERdLOlgJqTjzUJ7yfRZhJZHcjTNzoqGqIbEYLjjjZEJyMYYjDGIi3zPiLmvqRiW5an8vx+iJtn9pK0kmQaVG0vKdjqqxMfA6xi0U BVW/gTPI teJiBuM5sbyqWxP19w+7IErNr9S+iy6U7yQH0hTIOB96iqh8zngCZ0g6EYGeCa3U5s+CnkwwiA9we694b2zxRjXEYQggRwf/Q/IrW+OUzJfp8XNUw4plG4OrAb/wOOdKFQ/rE9eB9Iqc/dXcp+cm7DPOjb0Zt2eq1t7CGK6n77+X1V9Tyr0R4SV7BWZGl0DlTzW0B 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: Using pfn_swap_entry_to_folio() in __split_huge_pmd_locked() which is preparetion for converting mm counter functions to take a folio. Signed-off-by: Kefeng Wang --- mm/huge_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 94ef5c02b459..6139887933a7 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2432,7 +2432,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, swp_entry_t entry; entry = pmd_to_swp_entry(old_pmd); - page = pfn_swap_entry_to_page(entry); + folio = pfn_swap_entry_to_folio(entry); } else { page = pmd_page(old_pmd); folio = page_folio(page); @@ -2443,7 +2443,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, folio_remove_rmap_pmd(folio, page, vma); folio_put(folio); } - add_mm_counter(mm, mm_counter_file(page), -HPAGE_PMD_NR); + add_mm_counter(mm, mm_counter_file(&folio->page), -HPAGE_PMD_NR); return; }