From nobody Thu Feb 12 11:53:00 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51523152DE7; Wed, 3 Apr 2024 17:15:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164506; cv=none; b=flqBlwsdE4tBp61GnAbVNQ8sUtmR0uilGjVUNy6RdZv4oMTNRL1KzR1wFYLbgBKoOwSvDRuGgiB5oUsFN88vuB6OVfgx4mnrEC75NgsHS4cHOAg0nJCvueZe19V5BMtsnONDIBJKkEm0RJXygr9XAIe0uWAQI0lvknLiY+iJX5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164506; c=relaxed/simple; bh=YEZSyj08uAWUgvVNCL0bhk/P8dX/wHCa62h9mJQyDxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EDXrdaiqXHHpWcEYE8XC0dos0rjHpUhm9Vw/ffwwd3/WiES4yFnlCt/JVgwBpkmkrW3vrLBFMMBAVbhfAILLM8QP1w9v3fmCHmw8sYPY9mW60RcZUD3FUl9lD6Z5SNxh2pi7+ibbFZBXRTz5C6ZARJyRneWUsrnRLikEWY9lNgA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=O6+39Y3c; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="O6+39Y3c" 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=PV5UzSxT44kEb6CXRTq0MrEyiFGg30Ta3X7PuDVeqgc=; b=O6+39Y3cqfq3/j0yYE+/iPXAL0 hbwNKgv7dJBqPHYibJqj/20b3p6ucW8gY4agsx4sUkPXoaKMfQUANxQLb3T5GCU5p34NhrbzjoeBq 88619o6cVdcdZzPcLHEQIQKpFzlWZzsb3N7X75LAvXw0IEoDzxipLREDBUTGw8PAYheqJOcj2Crut Q6rxT/qcD3pXBfdtaZ9PqyULVT67OS/NwMmBFElvq5Gk0eseYGyD3QOWflvhIT1D3afPn/nVVNhVA Ppgy7ekTjYs5bX3147tEggxSQjgNNvY96EW7042kehl1iFkUzdmjJOxe87S5zOW+8eOnpIVehrAGJ pLRZNwUg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs4CQ-000000063wX-0l0Y; Wed, 03 Apr 2024 17:14:58 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/4] proc: Convert gather_stats to use a folio Date: Wed, 3 Apr 2024 18:14:52 +0100 Message-ID: <20240403171456.1445117-2-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403171456.1445117-1-willy@infradead.org> References: <20240403171456.1445117-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replaces six calls to compound_head() with one. Shrinks the function from 5054 bytes to 1756 bytes in an allmodconfig build. Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/task_mmu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index e8d1008a838d..5260a2788f74 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -2549,28 +2549,29 @@ struct numa_maps_private { static void gather_stats(struct page *page, struct numa_maps *md, int pte_= dirty, unsigned long nr_pages) { + struct folio *folio =3D page_folio(page); int count =3D page_mapcount(page); =20 md->pages +=3D nr_pages; - if (pte_dirty || PageDirty(page)) + if (pte_dirty || folio_test_dirty(folio)) md->dirty +=3D nr_pages; =20 - if (PageSwapCache(page)) + if (folio_test_swapcache(folio)) md->swapcache +=3D nr_pages; =20 - if (PageActive(page) || PageUnevictable(page)) + if (folio_test_active(folio) || folio_test_unevictable(folio)) md->active +=3D nr_pages; =20 - if (PageWriteback(page)) + if (folio_test_writeback(folio)) md->writeback +=3D nr_pages; =20 - if (PageAnon(page)) + if (folio_test_anon(folio)) md->anon +=3D nr_pages; =20 if (count > md->mapcount_max) md->mapcount_max =3D count; =20 - md->node[page_to_nid(page)] +=3D nr_pages; + md->node[folio_nid(folio)] +=3D nr_pages; } =20 static struct page *can_gather_numa_stats(pte_t pte, struct vm_area_struct= *vma, --=20 2.43.0 From nobody Thu Feb 12 11:53:00 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE96F15358B; Wed, 3 Apr 2024 17:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164511; cv=none; b=cQu6eiqV5xmdwig1eVRZnMdP93mN8HH6CYfBuw4U2MBGBEYLFdQIa2km14rkGbL6t+hnXntBT0RLil0J2v7mR0FACtDkWQHQNCkXAuHOsMlEnjBGj7IeSGNmpTlVhHFFGAsQ7Bhd2FSUYyIOQ8mBJCdy7PDTX/Ca9ben3SZ5fZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164511; c=relaxed/simple; bh=Ed0wNz8ZAEpCmpMP3hzl7NOmskAcmEE86UAbx5J7HPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N0mEr+aHSGrupllzMRE4sgyqZvDtuRMomG32+15iiTDb8LeGc9ajfPcPOeZI5UAJ/Pb7u4gBOSRCYknEUOz3hReqlyLyPmkcCs781xz6oqp7ji7FEd90xlxHNJAJEKVrl8NS9RqORIJYkhMw3lJj7TLZn+HaWDCpGcqP6aTGQfg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=uv9Z4GOP; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uv9Z4GOP" 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=wbcNRsb1B9OYyyrrlq1n5AUXVLnlKeePbbuQlBkeIGo=; b=uv9Z4GOPcU9GrYuVe8vFQvs4wb FykzKMLugI66A2IzTVi0QUC1kE9TBiYbaKEtcUK9zNvPJ1EkotCNOGAcZT8SHdsGMEUTjFagya8mL 11sii8ap6W1w9r+zeGgY9/t7ZpLQOIz6iA86bjk8KQoCfF7Y6+CQeHW55t9S6wSgcQ/YyT4wYgJTf PQZPiW4kNV//tGP6mRut5v0i2+tRoZvo6O2rnOFKivIFdAFW/w2WzRvm+7NbqKrf9YfRPBFLTGaw8 z5WiAAx1WFoOcWJhsC71C47cOizzZAZQ668LTjiXdOuBg2lXoC6kewTMi28sHFFRLGr7e2BoyQUv0 9Zh38Byw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs4CQ-000000063wZ-12bp; Wed, 03 Apr 2024 17:14:58 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/4] proc: Convert smaps_page_accumulate to use a folio Date: Wed, 3 Apr 2024 18:14:53 +0100 Message-ID: <20240403171456.1445117-3-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403171456.1445117-1-willy@infradead.org> References: <20240403171456.1445117-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replaces three calls to compound_head() with one. Shrinks the function from 2614 bytes to 1112 bytes in an allmodconfig build. Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/task_mmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 5260a2788f74..2a3133dd47b1 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -414,11 +414,12 @@ static void smaps_page_accumulate(struct mem_size_sta= ts *mss, struct page *page, unsigned long size, unsigned long pss, bool dirty, bool locked, bool private) { + struct folio *folio =3D page_folio(page); mss->pss +=3D pss; =20 - if (PageAnon(page)) + if (folio_test_anon(folio)) mss->pss_anon +=3D pss; - else if (PageSwapBacked(page)) + else if (folio_test_swapbacked(folio)) mss->pss_shmem +=3D pss; else mss->pss_file +=3D pss; @@ -426,7 +427,7 @@ static void smaps_page_accumulate(struct mem_size_stats= *mss, if (locked) mss->pss_locked +=3D pss; =20 - if (dirty || PageDirty(page)) { + if (dirty || folio_test_dirty(folio)) { mss->pss_dirty +=3D pss; if (private) mss->private_dirty +=3D size; --=20 2.43.0 From nobody Thu Feb 12 11:53:00 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C222153518; Wed, 3 Apr 2024 17:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164509; cv=none; b=OWugALprPw00fgHRcjmFSO+aFAnQuG6VznNGrXvp/Zkog/Nl8QHAvjQiRHcYbG3FLuaobCPIyFpX9kUe0oFqcgxSeHaWXvxSxwkaxAVHC7sZw+IdIwrlSSlaqpgsrydhgCnWzSPa+ZVA0r1HcyxXy43rGFQhaRLjd0veRg37fZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164509; c=relaxed/simple; bh=Z1zJd2jh0x47SO1psxPi+U7qqX365ISKcvVsxesxhKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QW+92YL5C5inrqZLLSYK1y47jukf9cfHWOI6F7xnj9oSvRXb5V5XocpIG02ODSoAqrEdnOiM5uBjVt/u4dIDy6f5k1BZ9DzDk2WdLPZKNU7GB6BHNuPSF21MZCYGL70fDnl6uFux9I93J9x7hxi58eRu58lpX2G+A7VhR6UMGTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=tLVspOYU; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="tLVspOYU" 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=4iptMz7iSD6DXWLkWwgnqB96gIdT8SCjbHmreUMaKzw=; b=tLVspOYUdHehXPrlIVsS17Syyx qVwDtTnKGCgJR4mEvk69rFbm1UtyJOYvOvsImj4sZVqVRMAfF82EkNnqcsP/GDFZ+xSfCkMFxDlpa rgYab8ZAq3rp8r94El+Zfa1AUrclnIYJ69fnvnyvrqfR5DEcfJsWQ3+O8AdvTWkt0y3gKWc4N2/eY zP8tVnypyNn6Q3D5+0dJ2XEJ6cEtiOUUeYUOhnPHsuyIGGksFX3KKeTRSbC5lLEUk8URVbJBtCthJ rNJpOkE8CCsA5lgBHr+lcyNXvEyPyh86qN13KNgPC5K/eBH1+Q8VtRp1f+Wdd+ki8k8NTpc+kRXsC 6oKiA7EA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs4CQ-000000063wb-1M8s; Wed, 03 Apr 2024 17:14:58 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/4] proc: Pass a folio to smaps_page_accumulate() Date: Wed, 3 Apr 2024 18:14:54 +0100 Message-ID: <20240403171456.1445117-4-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403171456.1445117-1-willy@infradead.org> References: <20240403171456.1445117-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Both callers already have a folio; pass it in instead of doing the conversion each time. Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/task_mmu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 2a3133dd47b1..6d4f60bc8824 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -411,10 +411,9 @@ struct mem_size_stats { }; =20 static void smaps_page_accumulate(struct mem_size_stats *mss, - struct page *page, unsigned long size, unsigned long pss, + struct folio *folio, unsigned long size, unsigned long pss, bool dirty, bool locked, bool private) { - struct folio *folio =3D page_folio(page); mss->pss +=3D pss; =20 if (folio_test_anon(folio)) @@ -484,8 +483,8 @@ static void smaps_account(struct mem_size_stats *mss, s= truct page *page, * as mapcount =3D=3D 1. */ if ((folio_ref_count(folio) =3D=3D 1) || migration) { - smaps_page_accumulate(mss, page, size, size << PSS_SHIFT, dirty, - locked, true); + smaps_page_accumulate(mss, folio, size, size << PSS_SHIFT, + dirty, locked, true); return; } for (i =3D 0; i < nr; i++, page++) { @@ -493,8 +492,8 @@ static void smaps_account(struct mem_size_stats *mss, s= truct page *page, unsigned long pss =3D PAGE_SIZE << PSS_SHIFT; if (mapcount >=3D 2) pss /=3D mapcount; - smaps_page_accumulate(mss, page, PAGE_SIZE, pss, dirty, locked, - mapcount < 2); + smaps_page_accumulate(mss, folio, PAGE_SIZE, pss, + dirty, locked, mapcount < 2); } } =20 --=20 2.43.0 From nobody Thu Feb 12 11:53:00 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FC2715218F; Wed, 3 Apr 2024 17:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164504; cv=none; b=Gavthn+ZVteJbkM2p+MpnR62E+9E28zK7JEVDbOaxmM4vDlzx2xvSWVarkxPp7fHgcJjUZGNch/mplG9ZJOeIuiZa6MDCySFdRBQVoK/EYEWNP3lJyGTL9oiEkvXZB30Vazmoe9iVwEH4yecgd/0V/6Ona3a6AJ1zHlXrsnO9mE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164504; c=relaxed/simple; bh=4NQWmwuZTarG2/kHv3KnA3lC4if3hblZ373xS71aU5o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g3asKn8rc/4vwkRHjaUNrcGgjhW8VSFNBq4Gj85b/IM6dP7P33eDCHnUKJgMO2r4Z6fxd7c40STKXkdReFajdD2ksbaVta0xoHBmV/H4b3nI9NOS2qvaNdjGrK3DvEAprgUAyQpMuhy7AIthX8MiZtdGbwaSI73FfJc0DBKHMXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=EyN7KUC8; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="EyN7KUC8" 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=zWvUIcsgXfFVuJ3plWmn3jZ25kr2d4+5CtI/6v4IbBA=; b=EyN7KUC8CWA2zAqaLb9X7NG1GP GiSUNPS5vCVIIMlu35ZijnrORpg4bFnx1SG0fwp47fcz0JivmxA4ljepc7FfUUJFStQIsk6geXoHq xuJGMUjuSk0Lsl4pnJ6N9a7wlNslepkcuIjr/DPavSZEIiqrVztxU8O/vh41CBlA27k4kcOvkiS8d 5uOUtp8fbCvv6mQcpkbzeJJ2w5WkFqPrXrheTO96txE5EdVCIUxEql5NtRwOOOtNW2Top9YH6kyEJ rWamjBmbFg90mAGxY/MoGrDN13bPd0cHR6ou2rSq0ZiSNiqDAGhEh2O4KpoyWOs27H8B5Ab1kEdAg n26ENKww==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs4CQ-000000063wd-1hvu; Wed, 03 Apr 2024 17:14:58 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/4] proc: Convert smaps_pmd_entry to use a folio Date: Wed, 3 Apr 2024 18:14:55 +0100 Message-ID: <20240403171456.1445117-5-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403171456.1445117-1-willy@infradead.org> References: <20240403171456.1445117-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace two calls to compound_head() with one. Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/task_mmu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 6d4f60bc8824..8ff79bd427ec 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -578,6 +578,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long a= ddr, struct vm_area_struct *vma =3D walk->vma; bool locked =3D !!(vma->vm_flags & VM_LOCKED); struct page *page =3D NULL; + struct folio *folio; bool migration =3D false; =20 if (pmd_present(*pmd)) { @@ -592,11 +593,12 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long= addr, } if (IS_ERR_OR_NULL(page)) return; - if (PageAnon(page)) + folio =3D page_folio(page); + if (folio_test_anon(folio)) mss->anonymous_thp +=3D HPAGE_PMD_SIZE; - else if (PageSwapBacked(page)) + else if (folio_test_swapbacked(folio)) mss->shmem_thp +=3D HPAGE_PMD_SIZE; - else if (is_zone_device_page(page)) + else if (folio_is_zone_device(folio)) /* pass */; else mss->file_thp +=3D HPAGE_PMD_SIZE; --=20 2.43.0