From patchwork Wed Apr 3 17:14:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13616510 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 B7AC9CD1288 for ; Wed, 3 Apr 2024 17:15:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C6CB6B0085; Wed, 3 Apr 2024 13:15:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 376C66B0088; Wed, 3 Apr 2024 13:15:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23E3E6B0089; Wed, 3 Apr 2024 13:15:05 -0400 (EDT) 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 0725F6B0085 for ; Wed, 3 Apr 2024 13:15:05 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 54245A1271 for ; Wed, 3 Apr 2024 17:15:04 +0000 (UTC) X-FDA: 81968870928.03.B90405E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 1EC17100005 for ; Wed, 3 Apr 2024 17:15:00 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EyN7KUC8; dmarc=none; spf=none (imf14.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=1712164502; 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=zWvUIcsgXfFVuJ3plWmn3jZ25kr2d4+5CtI/6v4IbBA=; b=M7QDSifHx03+kEQTN9fNSaYnyg+PKz4MbXzLW0pN0zwAgmFD3ZcbOXPnDTgKmDnJBvH9i8 sutMsuTeRMEX68pWmighbqJKSpCSUMbV8xpgJtp9vjUVOGdc9+R8Ju1yQ+zC3E0h8+mhlA CL3njw04+XlYcbez0iBVQ/eQcOk3/gc= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EyN7KUC8; dmarc=none; spf=none (imf14.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=1712164502; a=rsa-sha256; cv=none; b=5173NCF+WBK7j4zncDterNj4ucv9CiVPspZgXXwamtnSk2Qxj0neKuQWTiseYyCP2sYRci QwGsrqoDLGwE3knHUCIW8D+WBgXL9xFie5rtgl0g7Niv+cGuBr1Cr1krkHiCHDEdelDQgN emFs0yNF6VJ+PsSXXSK2bVW3eL7JyGQ= 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> MIME-Version: 1.0 X-Rspamd-Queue-Id: 1EC17100005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: iguondhffwzpu3qye4zojb5u9tc117kh X-HE-Tag: 1712164500-91004 X-HE-Meta: U2FsdGVkX1+j5onb5HEk8OV99XqGxY78woW17sd5yyW6cqPyy/J3Y51NZZamfJCDyT7lm9abTao1BqlonRFwMdDsiBNWB5BNC0oCo2ZH0GFbYGnsw1yfEQc8zvsEzbMRdYEBeGBWtMAgC+Wyww6sNiX+r74SIb5MSCuVwmln0Z8BMHbymT97QF3mymrVkszlTGdrZzWo+m8houP63zW835SSu/xg0VlBY1KlA1T89hMsePThe9AQee3vqzgDHqY5PzYaox966mKIAkcHa1EGfbHl/0YOEEzII/bPMgr+ElzwulQux/qN/6k8vpB61yo+VS+AL3UE10YF11NGHHRqhLF4uUP2LjtzibjAeArz4k28wEsALx9IKFFL793whAUiWjmdSMDNSXBqgnmDoM3lqGWqnSpOe3cEIHsE/Ec/tDTMyu5P38UyEY2TYud11qvszTPAQZZGb3k2bM2QiCmcSs+uFDA5ieIRGtQeKDcksO4h5aqNdcALKnj4wZUBohjQP0IMh52N4db1CGFXoEjHh/e1sXZBnS6u0iesw5PGUQEYzkskP8xhWeqPXz+ep5nN6z1DqnqTBVL5LpIYnYW4bRX0cwS9eGmS3Jg+5HBpv2ugL4MHlBw3hjrmEIXJxPY7SWNYTSQtl3bUWvccSzgCzMOA9GjOuMTA9rkxamDU6M94OPi1BP6SUVxfJdDcXevSr4eEPHiTz+eW9YeLZ1WgSG4Xt/nkxkaHdo+6+R553Jvmk5w9+JabdFgQ9/WPCOHm+Ot+16cKnrbsFKLs8gh+X3CApOP/Dq1Hu4BmWRQ406OHlD5eroegtWynzggDr5ximqBN6uuP8RU2ZwLa2XpueZ25ai8mJoLgYFvkhBrL7a2QeIoQ7e4Vo1gcA2kfGunao614UJH+Kbi09mCdq/h4U7YnYbXoevwR 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: 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 addr, struct vm_area_struct *vma = walk->vma; bool locked = !!(vma->vm_flags & VM_LOCKED); struct page *page = NULL; + struct folio *folio; bool migration = false; 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 = page_folio(page); + if (folio_test_anon(folio)) mss->anonymous_thp += HPAGE_PMD_SIZE; - else if (PageSwapBacked(page)) + else if (folio_test_swapbacked(folio)) mss->shmem_thp += HPAGE_PMD_SIZE; - else if (is_zone_device_page(page)) + else if (folio_is_zone_device(folio)) /* pass */; else mss->file_thp += HPAGE_PMD_SIZE;