From patchwork Thu Feb 15 12:17:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13558310 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9231C48BEC for ; Thu, 15 Feb 2024 12:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7CwYLavlu+AwScLHjnjvtJnleTAnW2aN8s/ldGbyxn0=; b=Mzb9v2bDr0lmUi ERRqFkn9NegdrEIfOg9zcz0+Rlwzk71SIu4N5Cmh2Hht5x85k9n/V0+ZQgeLilPCHvo0oZiAJHoto aoz8OnFuOPXMU+t/ubKq+n6Lajyyt1ENBv65G1jjg5DONyl3LihLoLtgtAzXjXp2Ck8lGsOKbwG1N 49ZQx8pVASHIfanANjSScvS1bCpJCjVU6egyoL9PUhbVKPzeR26icjDP6u8hcsHmI25fj05KxwIqm IxLtgGhYFAoAFq/HlkKxaO29baQMSZGf7jKety5kwlaal6Rb4FKf8J2XUrbWeH/OgDbOqstPCHsyM jr5ShtLC9tLCRD0238ZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raah3-0000000GCIf-2TFv; Thu, 15 Feb 2024 12:18:21 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raagw-0000000GCCL-0YNX for linux-arm-kernel@lists.infradead.org; Thu, 15 Feb 2024 12:18:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A35301FB; Thu, 15 Feb 2024 04:18:54 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07C203F766; Thu, 15 Feb 2024 04:18:11 -0800 (PST) From: Ryan Roberts To: David Hildenbrand , Mark Rutland , Catalin Marinas , Will Deacon , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Andrew Morton , Muchun Song Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v1 4/4] arm64/mm: Override ptep_get_lockless_norecency() Date: Thu, 15 Feb 2024 12:17:56 +0000 Message-Id: <20240215121756.2734131-5-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240215121756.2734131-1-ryan.roberts@arm.com> References: <20240215121756.2734131-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240215_041814_310941_CC6A1ECC X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Override ptep_get_lockless_norecency() when CONFIG_ARM64_CONTPTE is enabled. Because this API doesn't require the access and dirty bits to be accurate, for the contpte case, we can avoid reading all ptes in the contpte block to collect those bits, in contrast to ptep_get_lockless(). Signed-off-by: Ryan Roberts Reviewed-by: David Hildenbrand --- arch/arm64/include/asm/pgtable.h | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.25.1 diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 401087e8a43d..c0e4ccf74714 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1287,6 +1287,12 @@ static inline pte_t ptep_get_lockless(pte_t *ptep) return contpte_ptep_get_lockless(ptep); } +#define ptep_get_lockless_norecency ptep_get_lockless_norecency +static inline pte_t ptep_get_lockless_norecency(pte_t *ptep) +{ + return __ptep_get(ptep); +} + static inline void set_pte(pte_t *ptep, pte_t pte) { /*