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: 13558304 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 2D3FFC48BEB for ; Thu, 15 Feb 2024 12:18:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3090E8D0017; Thu, 15 Feb 2024 07:18:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 28E888D0001; Thu, 15 Feb 2024 07:18:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 105188D0017; Thu, 15 Feb 2024 07:18:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E96E38D0001 for ; Thu, 15 Feb 2024 07:18:15 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BBBB616108D for ; Thu, 15 Feb 2024 12:18:15 +0000 (UTC) X-FDA: 81793940550.29.89DC049 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf13.hostedemail.com (Postfix) with ESMTP id 3103220005 for ; Thu, 15 Feb 2024 12:18:14 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707999494; 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; bh=djYJwShBq6wbk5Xppr25LzC5laLJijpWrzDCEzEspN8=; b=t0iRsjoVG3PqbzslPM72JZZmPjlKiDRYAZGfQxQhh1aJRV3u5BodMUP6bCBmwuid0t+hqJ F5HYpS2svATHZJxEfTFNUiWkCffywx4ig26ti0jD28vvTv42xDQeKV+o5Ei2AtCOwHJpoS 7tMXDScvJbeBtjZ8MgTcZhUeb2zkcvM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707999494; a=rsa-sha256; cv=none; b=bMPA+qOaINOWNaWzRvy78F8tacLCVuzEcpq3+5sq9t2/hiykRsic4UKvohjgkBfyP+llBU FfFKZu5NaMAPaA5g3NtFaltA6esqcJuj6rPC+nwXsWuANm49przhD+8hDZ2t8VmVLbyIT0 q9PC4Osyw0Myw6VYWDP8rvfFH1bnYAY= 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-Rspamd-Queue-Id: 3103220005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: whue67oicgghcz7eryqynxnp47cmnwwp X-HE-Tag: 1707999494-15701 X-HE-Meta: U2FsdGVkX19haHf5C8HOd1R91wEYJ0C8WZt8CAoEWRKhU+ywqQvuiB9tiStI3nhyw7zXFp2muo6P+KJKVIZWJx+LSEYQEq2UpELaaSN3xbW3dhe9uIQ3bwYoucs/F2xS+OTcHmrxjGEGRHolkAKS9v+u/EqA85EulLUpwID7Y+yo1SovusLR27PifvCzjrO497E5H+Az1EZTkapxFKl4T2OFPsoh3J5U+XZo+Wqr0Sl8wBz89zJsgarbjhP3KUzoQiu9qZ/LglsNhDdzHd9UC55DLR0PMQ/wcILU+2LRmxz5PhcY8NMpHbU1hMKC+PABINP7QuZhvqpJD2qkGHICidMYiPvD61CK1oihq0rEFbQ8Rw8eHpLDT2DzsejKZD73lD0utD0bzfMrqD4HBgi91RJLpkraVYl/mIhtQ7NAAmALenpB/62sHFBbICrFa6Wz7PgjAKswwLp85+O8HpOWBe8ta8JoVxfHNiCfI1AU3yjtx5H/lVwxfvkTbKHBjYcirYhFXwAB0IGKBK71p5HWQYQpfjnZrGFELXik79AXq5HBxrpNhtFrsXwbz5OWPHOq2IV2RfCi9G0Qciog27kPA7pHzbi4APdSzeuiaf+2NHs5gXXxW2+c3SRHeoy5XhnRghfvxMQHYK2DG/CG3ybG3adfzsOCZEB9AM9q+8/59tWgb9nBETvpCDAc7+rU3MWkRwX01D57U5vSmTJS71xD0gK3PxIbe36/VvrhLJf3kYp4n6gRFy2wU/RBH2FjKmN3+AYciKiSKO/GEETxfhF3T05amPI8yrE1sdPeE++4tAQTta0pUAnSlg5CZOL+aR5CW0k8lQNt3OpZ6CzmwM4zyl0t6kY2aDh/p5Eekrdrt9dXZSmmHTPBe2soZu91fRu/GatHCzF9nLyC2A34A+dUVc65InY2PiBwYp94W0GH+FwtVppM1xbXUN1aba/nI+uZ2AT1S6QUyBerCsQnF8p jXLMlKTh h6EghcMe51MmwgYuJpBWrIvZrLOvDAe8VVJWXvFjBBdEpCsKh6E8wT8xAjvzfDtWshMN0hpD7mJbMVqtCkECmS+XHXJlnjXSdWPuuBBTOdlKg7Aa5H435omyEP9/EsNhs/DxKW0FFzRQl6wVdodnNuDILvDZe/unjI1bW+B+sTcRxp4DPwkRv324wMSh1/uA+HKJCPy7o1dHs9pRfIAWD69escPe7bVHP67OH 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: 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) { /*