From patchwork Thu Jan 11 15:24:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13517537 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 718BDC47422 for ; Thu, 11 Jan 2024 15:24:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E3676B0092; Thu, 11 Jan 2024 10:24:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 093966B0093; Thu, 11 Jan 2024 10:24:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9CC16B0095; Thu, 11 Jan 2024 10:24:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DAED06B0092 for ; Thu, 11 Jan 2024 10:24:42 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B0A7240BB8 for ; Thu, 11 Jan 2024 15:24:42 +0000 (UTC) X-FDA: 81667402404.03.BED0B36 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 2A57680005 for ; Thu, 11 Jan 2024 15:24:40 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=SumA547o; dmarc=none; spf=none (imf02.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=1704986681; 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=ylZ6GfCWdkm95QXmE5YeGp/GcqdnO5+70q964u8MBL8=; b=OzjEKcXAn084Ei11p7Pk9OwmyvnwZ3N4V9UOcmmTX7bYS8tRnUr65aGfQZDdOMqq5af3/i 93+3S4J80kL+ROe8+QPd//LFJPH5XzELWj9p/AAzxOCZxhxuxFUh1NeD/tV/zxRlZAMFNt 0qPFVd06hYW370xFe2rVeIAE4UFleTk= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=SumA547o; dmarc=none; spf=none (imf02.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=1704986681; a=rsa-sha256; cv=none; b=ehJt2xEXsx1lGjrKWmFvAXoh6xwOfmX4QgMbBUSxTv4wsROb1R95vTWrftyHkF4A9N2ZAJ 8N2l1Ik8IaoQdnMtbcurnk43Aydk/nMmfhnvqkVA7xjyMaQTC5a8vLGpuz0lrmYrILGn0R 6k7ehFe3vFtc+wktdniXIc7D9jBIBf0= 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=ylZ6GfCWdkm95QXmE5YeGp/GcqdnO5+70q964u8MBL8=; b=SumA547o68BIVFAVAWeLC0QQW2 NALZ4tmVt2xXo3/c1xlq57lcAwyPCP2kKPW/A9z0fPfpbFFabXPOxNJI9ueJakDzELd4d2kBSuBt0 k3jzIdFIv7HisV0LfiHPCeiZDSLaKI4SM46T1j2b5/nLq8I+4172YBORhTGv63LOlLSyP4oPJu2Ok TT8j5GYv8GpIFio2Gd1fpHiXxQBDNSkGvDDtVjoQvnklfKYa3RaixQ2eM8+Y00SeLpEd802nEAIIc vpMUgCt/xcJ0xJ6E/J43XNGBbNRYaUf5eT4FsNEu4ytz5xGjenITQpi9vLA0X69+aLGSuUrhqtoXj fnUBg2zw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rNwv1-00E9ss-Sr; 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 07/10] mm: use pfn_swap_entry_folio() in copy_nonpresent_pte() Date: Thu, 11 Jan 2024 15:24:26 +0000 Message-Id: <20240111152429.3374566-8-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-Rspam-User: X-Stat-Signature: w5an5sc74np1qnh5i9zqy8uhur5mhy3t X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2A57680005 X-HE-Tag: 1704986680-426103 X-HE-Meta: U2FsdGVkX19iRexUmrY5awxtU6xyw6sl6txBjW5mRYHlX/5kYBY5qfvEF3i6NTwdQIuomc905iAwLX97NGqCKzcU1vYkEFLsNzhmIXDCDsy19MgZmdsSazFR/i1RdsZquVkM6wm5G9CMlFSCbiVWAP4qjcqCEkWzJcmOTM/eiwZE7qt6NDMvw3h3U5yo9D4JeQZRX7rw5JDCEMAvbSNhu31h1jmYztuSiVJLJbg9hEKmfA4NqoXzVO9cqLPRlbDnBAKmIsb+5OS+7Dh6qOjagzgX940jS8TI4ZO+Xkr4VAqhYLhkSXsTR9v2YfMAC/urnv96n0rOka6lo4h1xUe6Ye236whBN/8t/8Wj+qCzAJtwTIUJ8YNWFvgyPcthG2E7fXaGNkkbrXZ9hxHeNqBUL2t8VRFLYiu0XQqy4r/GkmeutByD6z+OSXHxi5e/pdSaEdB/ejJ+qgYV/KJfi04KlVOZDYxzt/g1s7LcwbsHppraDIqy4aaOJT4ILf3OGRt/m/ffs9Y8+iTnkFwnMJqklaIaNmYJwMGDCFCzjWMhlema7RxMUpja/ov7Bz3uy0UlINlhYcldXR42jUS8XWsdZQt6ViEwWgbueHzgGQxFD8RyoaBb6i6BNuM0acW4W2mOmVZN/JZC8DOaCG0Bu+eDOcqkPcjLRn5zRaXfBZP7lWLYtEwfUbniEg9+aJr+vGTtlg7oyeH2Yx1ylA+xTC1F97SHv0Sg9SpJCXY+I3pgchX9FJs3zQwhC6KPrcKS2cXU+XiqJqETfIOAVkcBiMrfS6pH9dNfgqvNU8bObNOVdfaQl0oNN9zu6nxdV0+Mx/VhWgUNOmywkSELR/iVwvDqrWK4/dup7k3okOZadrBM2gFmg7hLubNGq39gbBhq2kTpgrgrB9HXPHq0E8ckhNitu5FAxE+GBh0F 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() as preparation for converting mm counter functions to take a folio. Signed-off-by: Kefeng Wang Signed-off-by: Matthew Wilcox (Oracle) --- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 7e1f4849463a..60aa08f2ccdc 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -806,9 +806,9 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, } rss[MM_SWAPENTS]++; } else if (is_migration_entry(entry)) { - page = pfn_swap_entry_to_page(entry); + folio = pfn_swap_entry_folio(entry); - rss[mm_counter(page)]++; + rss[mm_counter(&folio->page)]++; if (!is_readable_migration_entry(entry) && is_cow_mapping(vm_flags)) {