From patchwork Thu Jan 11 15:24:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13517543 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 645D7C47258 for ; Thu, 11 Jan 2024 15:25:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3CB16B009A; Thu, 11 Jan 2024 10:25:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EECC86B009B; Thu, 11 Jan 2024 10:25:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDCF46B009C; Thu, 11 Jan 2024 10:25:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CAC926B009A for ; Thu, 11 Jan 2024 10:25:01 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 96950120B7B for ; Thu, 11 Jan 2024 15:25:01 +0000 (UTC) X-FDA: 81667403202.28.800642B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id E7FB61A0003 for ; Thu, 11 Jan 2024 15:24:59 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pPLym1Dn; dmarc=none; spf=none (imf19.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=1704986700; a=rsa-sha256; cv=none; b=ZHER5SuL2TD3kFR3Br33uSMxRpQmQueeYk9OmwpCkPQSLI+jNobKN2WsHhFY5xwhQx8g97 yW3O8t07eUDA5+fOzZaSksXb8V4EHNJHrOlQX2YKaUwx0EB9St5eIsT9IZTW+3v1VrK50P IFDnxWYwgk6NOnoqeWtcZegkOtdPCGo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pPLym1Dn; dmarc=none; spf=none (imf19.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=1704986700; 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=NG4y6T5mz41ygruMS3SPucdfvQG3VJprEVuTqUHC614=; b=Qg3yuh4CVOg6C57UpzGIlJ7ft1q1O9tzAEwkqTI1zWbwaYsOSNYtu1I1lB6tg6kiueIQuQ K3hMlihVBh6GKvzscYCVgvEW8U4EpvPXnpJFUh555CFf/psf9chz8s/5h5BRG0WT1vifCc wKK8HUtmNTPlpmjWHQmfX62IrT/l0/c= 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=NG4y6T5mz41ygruMS3SPucdfvQG3VJprEVuTqUHC614=; b=pPLym1DnNyymWjJALWJjq2mHEM u4qfQouuoLahhYk4rmRuCH3aBEuXKY2qzRFtdZBV9nqNlbL3w1bznnWqZ2cjz1V7pKPdNXC+KwSrc RjG3Kao3b7GmlG8ugDoLZwF4ONppDbbEjAZP9VBAuaXWEyyVsVK6pSA2BfV47VryGC/vDhO4aGQZD wgNAQo7kiXKQksSHJHZ40YZzGE56PMXLqBndckgnu3EJAx2GdlENwLHxHllsNpSf8f12YnBVU1mzG LGOBQ+NummSIPdHsBYyh/VtX9c2z4DtMxWzEzgIg9j2VDsBrnPRHhl+lyMZofy39Pd38bP+x5JraV oN3zt/gQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rNwv1-00E9si-DR; Thu, 11 Jan 2024 15:24:31 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Kefeng Wang , david@redhat.com, linux-s390@vger.kernel.org Subject: [PATCH v3 02/10] proc: Use pfn_swap_entry_folio where obvious Date: Thu, 11 Jan 2024 15:24:21 +0000 Message-Id: <20240111152429.3374566-3-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-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E7FB61A0003 X-Stat-Signature: kkx691c13m3exfy3dd9b6xuefbb61bbu X-HE-Tag: 1704986699-260471 X-HE-Meta: U2FsdGVkX1+02JcmvLvVHM3720GursLKZDe8gZB3kB2PJIqwZW2YoGbiwcNohf6v60hcfczQ1VJD4PlccUlxTiLNVlaq0p9hwcgEsCovIsRfOE0T0qPzfXl0cr2s7lgKM50TNNwzLjoL/uFHt7dloTkBahtO46jLn8LlcaZS9DVA7Sb5sneLmui1ZxGHuH788L6U8OOHByV5PHcM3AIPnm6hc8YatJT4IbXROjyhU1YxSFdwC4w4IQmcVwqgIeCxEOHsto7M363mVZxWRvAKWYuNmgqG8zNzl73Cbz0WGhs8iRojnx45WMmfvaRaonPeRmsJZdjVQggtMgVgr4WL95Ty4kUjzKeFYMkyWATXFSmwW+rM/aKX6OxUsgheehnqWL4jNMtLrcPX2Y0cWdd8ChSMrWMXNdCC/F/HY4IvieIqdSNCr54a31hNQb0Mtiggb66PeXS/Mdew4d/BRJfR5/XKtsHyZDvqNoUKk0W+B8rRSbzMDEAriZPJs/3JgTmtRdf+k/oR/0q+biFVb8RcxfUMaY76fJSK+7jd81Vc3zbvogDbcX3vpZAWBK5IZsq6eLb5KWESf/OhlaN+PMIxwmAEeqr7p7KmAuPi12sxguPWpWsebPb7ahP9xxBO7zkASYEC7iSBAZdFZkIZEyJ3hg+zwVY5FnV0jUzUtY6P+sZVr2C8HSFztdHEcQ9GRlD9nPfnl2WlpYINiSD/T3TsAyqP+Rdx0IiF4t80aneto5ArbtCb+0F5qJCUdrXhIVrxF71uoF4x4KMm3yZ/aj9khbIiYWnD3aPaz4oaIdNqcA0vXRzkJG/Ki/+ondTDLEzbffII5FOJoDLIwTVBaPH+fvg2e0sH77Y2Yoij6q6okidCIKBlCLUWAiTAmV8BfWz9tl/42YsNmoUJxIeNgJAkg4ofbhukCO/IiGZCPLCqEmD2fAupkHFprvaf1Fn5uPJSsGSaI9LeKhiV9oD5oPm hthSJ4hA 5Fd+SqNRC99i6196eO7jdkLZrVgneUhyYZKp7dMmI13cf8MtZfosfb8AEF52PFDr6ytbTbXTZHsrOMmngtELtKQUeG9z+pIdXHZIgwHTkh7Ut9W3lq5ET+9WHOS+ZjW3k8xv4i+ZsWVslGwqP9viBzBFpQBkdBxwXt5aEWuYRiAq8CZX/aDafhNT1I41P1hF88UaaFS3Cn4/1hqFccVhNtM3XgApQAtkhddG7 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: These callers only pass the result to PageAnon(), so we can save the extra call to compound_head() by using pfn_swap_entry_folio(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/task_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 62b16f42d5d2..6e75bfd6c3f8 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1807,7 +1807,7 @@ static unsigned long pagemap_page_category(struct pagemap_scan_private *p, if (p->masks_of_interest & PAGE_IS_FILE) { swp = pte_to_swp_entry(pte); if (is_pfn_swap_entry(swp) && - !PageAnon(pfn_swap_entry_to_page(swp))) + !folio_test_anon(pfn_swap_entry_folio(swp))) categories |= PAGE_IS_FILE; } if (pte_swp_soft_dirty(pte)) @@ -1873,7 +1873,7 @@ static unsigned long pagemap_thp_category(struct pagemap_scan_private *p, if (p->masks_of_interest & PAGE_IS_FILE) { swp = pmd_to_swp_entry(pmd); if (is_pfn_swap_entry(swp) && - !PageAnon(pfn_swap_entry_to_page(swp))) + !folio_test_anon(pfn_swap_entry_folio(swp))) categories |= PAGE_IS_FILE; } }