From patchwork Tue Mar 26 20:28: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: 13605070 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 B1D14C54E67 for ; Tue, 26 Mar 2024 20:28:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C45346B0099; Tue, 26 Mar 2024 16:28:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 89FBA6B0093; Tue, 26 Mar 2024 16:28:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 679C26B0095; Tue, 26 Mar 2024 16:28:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0E8D56B0098 for ; Tue, 26 Mar 2024 16:28:40 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C83B41406DE for ; Tue, 26 Mar 2024 20:28:39 +0000 (UTC) X-FDA: 81940328358.26.07429D7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id CC3B1140015 for ; Tue, 26 Mar 2024 20:28:37 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RcI9e6JX; dmarc=none; spf=none (imf26.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=1711484918; a=rsa-sha256; cv=none; b=AqSWUIyi9dk7aj4jqVjThuAmGjzcW2iHhoyv92kBT06oR6+OGkSfIXJ65tI0UrNRQhqsM9 c5NtxB/RiuxVB3t4Tymdryrdqyfb3gUhr2BV1Xdk7wWae844UgPl+KQetQwQEpJ8ujHgLO tyj0450oUkAufLodjcNqrkzFvGxi1LM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RcI9e6JX; dmarc=none; spf=none (imf26.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=1711484918; 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=tqTrfCsLVUpO7BugEdTxqQoWqJdTsnkKNlvGkBxqLaA=; b=o4s9DfnPDEfimCy9VPH/uMSGpusma7VPHQEUq1yjmBoSxybsxM/yTsSd4lISPcXvQ7FeHl 5vRul/eYdW9c+eWmUzRznY4lv/5CBpSqUx8T1vWSpFYsD9pdc1+DxtvOtfhkSTGv5lv71X JoPlntEgjMxujHvOnZ7bMRy/V4U9Kf8= 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=tqTrfCsLVUpO7BugEdTxqQoWqJdTsnkKNlvGkBxqLaA=; b=RcI9e6JXAb+jplwu/Gg/0XJJHT 0oqdMzS3blalS+NwfNKbV0W+Zc9lUzw9RdXZW2oTZsmMnF2rsMcaCP43nuMz4BBZwb5BUWnSvYXjK fQ6X1bTkZs0OFtdn1jBJEgFTI96snnI0l/cTfUGhtsHx+avXhPCXFj23IX1K3CqUg8L/apZievtwR P4iO21g7WSnKVAuIrrKqqN0Ae1PEljWSlT/Zp9BewP4yUWIlZ5aT5DM8DKEdZOUjBptyiPO2KCWTI TMervibh8yT+3Rae1asYZNK03ge859rhp1ql4308BeLqUwcQKDTgyWXEUs22lyqF6eloR2uf7wacb cLedaLxg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpDPQ-00000002CGF-1EIZ; Tue, 26 Mar 2024 20:28:36 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 1/8] sparc: Use is_huge_zero_pmd() Date: Tue, 26 Mar 2024 20:28:21 +0000 Message-ID: <20240326202833.523759-2-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326202833.523759-1-willy@infradead.org> References: <20240326202833.523759-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: CC3B1140015 X-Stat-Signature: 5pxqca6dijbjk79zy7b34j461w4qwt6j X-HE-Tag: 1711484917-460570 X-HE-Meta: U2FsdGVkX18WtX2qSjtdrj8lCl+xnFG2FXN4nXPfBIwNKTEQMB1RSL71xr/scTWyEKuY4ZTSoGhaoY/Hxhc1GchUQlG4ry/bpG9Yu5t3hOBVISiE8SCUPbCHyICLdn8QR/z1GrU17tRHNfm9NgvJz5PsytPW3VXCFiU7nXluNIBCnsHkgDU6MAKfCuwggBYF0ypKQr9kf+nz0why7k0MYkZ3zBCZlHoVfwRxOkFZkgBfFQksJeqpSE3pQ8QkvCTMhsrRa6OhQ88/1AeCykr4HhFVZAqCykH12c0z3i0DWSghUMYbv/ZXEon2YcfYOwKSyEhx63ttN5FauEX02087uT5qLH2xj7w0SGYdLmDBmUFERP3XREZVcq4jcpnyc7Pp2FSiaBPsXuyRvnKe7Tr9g6W/8sqs4SHE5iQpO44KdDT8vpWsQ52ns5HByu2T5OhU89ACBiPf09mWc2LBMKn8X8Np0C8ftxydv+ywOfLoD9VpnzlcH09xl4yIygTDV9NOHOYkGtS8e3EIq+l+hB/t9L/VlrT2ORpnmiNPYwXyvEOUAhYo+DwUq4yc2lf0gHWE6C9PmXJMpCdhdjUIkPcPWWpGfbqm3DJTHglw4Rzs8eJ1DESQKEZFAvQDdY9+IKJUuPITPgcXTg0jtE0hIhkqI6xu3I9lzFAC7z2BgFIC0I8rgOZqK+YzRJP5RspadSo4XdBe46Lif9MeoKnYwOJo6woBoqd+AB5jTOA6DRNq9p/XgMZCtoJiGSXJ/cbunzYRaL7q1qysiW+TpDctycQeaT0/IhrKDI7cCUjS/4UiRw1WQ5H+oA3C/DhdbINDI6kwYDxyrGP7aCRHg8uHHezhTUgKFEQU64YysCRYC6eGVS8/DJYPKahe9ZUDXCZ3Xur3qIOExIK4fGekceFQWEYo89LN8KxjPopziMsOpsn1MSxpKxUpFa/KRKEdBA8OelZy/COP4/wo2/uoWWSJKnO IjxgKfYs Buwo8L236W8UvILogALJC5GSsPTvlx4Rql4ILSs/qyzXkYb21p1uhlZU8Zecgz8sqW8ZMz8B9GcB4QPkvUdqwDpV5HyO8tVIfY/0xcZhn0EaULUG9Va1US/yorv1Td5tA0TE47ihx2bYtvxUzV4u45elukEPfrZHHtJi7PX/zi01p4y843kWSPtF1cm1LJK2b6zMVwQelNkeA9z5wVKM/+1xdonI1sFs+EIGg 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: There's no need to convert to a page, much less a folio. We can tell from the pmd whether it is a huge zero page or not. Saves 60 bytes of text. Signed-off-by: Matthew Wilcox (Oracle) --- arch/sparc/mm/tlb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/sparc/mm/tlb.c b/arch/sparc/mm/tlb.c index b44d79d778c7..19642f7ffb52 100644 --- a/arch/sparc/mm/tlb.c +++ b/arch/sparc/mm/tlb.c @@ -183,12 +183,12 @@ static void __set_pmd_acct(struct mm_struct *mm, unsigned long addr, * hugetlb_pte_count. */ if (pmd_val(pmd) & _PAGE_PMD_HUGE) { - if (is_huge_zero_page(pmd_page(pmd))) + if (is_huge_zero_pmd(pmd)) mm->context.hugetlb_pte_count++; else mm->context.thp_pte_count++; } else { - if (is_huge_zero_page(pmd_page(orig))) + if (is_huge_zero_pmd(orig)) mm->context.hugetlb_pte_count--; else mm->context.thp_pte_count--; @@ -259,7 +259,7 @@ pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, * Sanity check pmd before doing the actual decrement. */ if ((pmd_val(entry) & _PAGE_PMD_HUGE) && - !is_huge_zero_page(pmd_page(entry))) + !is_huge_zero_pmd(entry)) (vma->vm_mm)->context.thp_pte_count--; return old;