From patchwork Thu Jan 11 15:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13517545 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 E607AC47077 for ; Thu, 11 Jan 2024 15:25:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 837AE6B0087; Thu, 11 Jan 2024 10:25:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C2F56B009C; Thu, 11 Jan 2024 10:25:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B9656B009D; Thu, 11 Jan 2024 10:25:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 55AEE6B0087 for ; Thu, 11 Jan 2024 10:25:08 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 39C03A0CAA for ; Thu, 11 Jan 2024 15:25:08 +0000 (UTC) X-FDA: 81667403496.27.375AAB3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id 33AD8180026 for ; Thu, 11 Jan 2024 15:25:05 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qYMJGgwr; dmarc=none; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704986706; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DpHWtj8UeAQGvemXnNL2ch0TeITvLAzMMm0m+IyVsmc=; b=qcxa3SB/nDXH5bfJVfNF2/y2uUjdELx/42xqq6YE75Tjcb4HAPTsGswOkodlwRrjXP5Ica 34as19RwDjCHlKZKm50red6IZz/akZnYQG+xVrLQdKVQYu0Si2VbdVsWNg+EGHxK2s2Zwk AA6WBxXFYCgbxxIo5SMcg3UK8T1f40g= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qYMJGgwr; dmarc=none; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704986706; a=rsa-sha256; cv=none; b=eBeCHztqrMIfsQ5zRYjnD41GoJj7Km6IK2PkpEbRaZmI6ERvq8sWaBGlEX28sIaqZRjtdi RhUSrz8TDmAq31+0waHeiqTtjsANIrjjHNutOIhcCD65f+9IzhjXEj2d+Bd0C+YhDqowwO T3GkylAukdK448/68yhA+cvJPkW5lBo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=DpHWtj8UeAQGvemXnNL2ch0TeITvLAzMMm0m+IyVsmc=; b=qYMJGgwrJjEPeRzi/f90dt3Ozv 9PQtyqzziqRJpX+p40XvKLJkluq16ySvHxsi/iO67TMJPEubaqLslIc5g3D4vRdUHJG13tz5Cpdjf ghhn4AqibXxTlKUv6JnRmmflcyCGENaiJkF4NuD29SnejdzIXfZSIt9oE6dQblAAmMor022zW43vN S7F7ktILemN5A3vIi5n3xNRDerODTZUS2JFmM46GapYJmYSWFtGfNspu0bZ98GgvZJpggwQ3AVNkx wYLjOg9D2eiSjbtR+iqteYoh0PJyuqomx9uDeW8CvvHSc0ap4qa1T8TaI2En3zu+SE13VcoatM182 Da/ZJtHA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rNwv1-00E9so-L3; Thu, 11 Jan 2024 15:24:31 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: Kefeng Wang , linux-mm@kvack.org, david@redhat.com, linux-s390@vger.kernel.org, Matthew Wilcox Subject: [PATCH v3 05/10] mm: use pfn_swap_entry_folio() in __split_huge_pmd_locked() Date: Thu, 11 Jan 2024 15:24:24 +0000 Message-Id: <20240111152429.3374566-6-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240111152429.3374566-1-willy@infradead.org> References: <20240111152429.3374566-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 33AD8180026 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 9xr8gnodtraw8zzoff7d9rc88gbze5dk X-HE-Tag: 1704986705-994524 X-HE-Meta: U2FsdGVkX1+U9ILmp6kD1jynNbHTrwm+15Li/WnEStorBgt56A/UoHVoSTr6a6m6Fp12j1lALAeWzMO00Rch6UM2V978bkzlE4/3EPs/umAj9MzlnX6mIz3rdNxRRk7+DQB80NGn0OvxtAowoNJ3WxZiFSnP57lGR92ONoOAgAQ6YP5d3jZeHnc0LMTJNs6o3BC5MbHygwchaxLBRKNe3id71Dq6amMqNMQzD6Dm1Y6eKzbiPH5i59FtXCYDi0huR99+p3ES+YEA+veVu85RUjQWvVKg9PiCBLnUlbphunYMVAMhQPpsug2POruW5cQ2yjbI0zWiJBoyGfE+yepJh1ck/9gTZ+AhwAFVEjmF9qALGhznHQIgvdKwWKwbFFhx/CDT+sBURe6WQ/qptnmnUK5GNO5J36WjWMZS5N7aNDnpRdsZvelji+LLLlRUtV+5NZCo0xkt07jesczwKMNQy+IWErlRd78FQJuQXN8PuIl/3gkoa0CPFryv+pGpe7W4ak3y1bh6hZfmKQ2N1fBgxHDdv6NLaUhk1uQdgWrnAvyhSJaiURCijtQY26MO50pcnp3oASkkLwWHEVdVtEdYoQdOnwbnbINAjVmxGwlr6RGAffGuoAryTZVf++2yVe4wrunyNlY1ebZAeRQSnyZ/nrt9Q44FmQpZjgEGybzYMSSzf7sBYL74/QttrsRxSpYbqhlIMkd900K6+wY3w5d/au1cDQP9g4zijv2aC8/bk98tNlSs20qSia8MSu623K1UaxEUoc9/nZushPK/1Pb3lmWM1HdSzSVKOYu/84uiVAYFZB/G1lrJgaONZTy9oRGrscIt75RvGGjLFzJWI7oD3jgHr9ydA+Yj6kvxE0S5qlCgyGkZTOyzTqq3aLodlM8NX5osiNA0capzYXCGoFSHiq6mg7mi3oRYZk1a+MRl0OLUHo9wdIjlexkafj+QBcO4fc7g/YHu4FIRYDPyMdY Qs/+IKHO n+FaJZ1QixDWJnCYhmDBfgmFz4hb3db7y7+6NaTUcPWxJtq6tncydP/AqJ6yJ7h6flg6qD1v1ZoyY4ZsYPk4i5b8VbLtY398vnXXEm4NLd3cawY3H3wwUEQt/heAnE00E0R30qgDoO7qRrqMF2ZC97DvRRgr0DA1WLyqoA/rfswEq8Hyboj6K0xrNUoLLUYkv+e7VZ/FoApD0vl4Y5pYmn7Df7crM2pyZw7b9m1e11WlzNGNG7B+BvNto+w== 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: From: Kefeng Wang Call pfn_swap_entry_folio() in __split_huge_pmd_locked() as preparation for converting mm counter functions to take a folio. Signed-off-by: Kefeng Wang Signed-off-by: Matthew Wilcox (Oracle) --- 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 5b2da360ae0c..4ad1416b60e3 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_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; }