From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796118513; b=mYIq6VyGuvMdRf5N4ZuU5EmT5G3Y7LKsStTUT/dwYUL8gYc8O4Vj74YF7lwpOasfZ1Ly g+l6WYEdEz3FufRWllLuIJvuCrOHjzDpGxh9xtwfwREIEGPyKmyYVapRvsm0F0hQ/8/wF mJVVfGyMBbtelRHaPq+wgRuoAVagcF2oJrY3jKZ/WBQ8L6VktBhGaUoh614URwn28lSee 6fU2TmSdIC95vYd9bPj45nb+qNSwdXfPnrxi+QnhRxmIaNaojL7INKgex+OpIZ8PHfDFU K1xTdXOGsMY255d7zdO6Fu+INNsDffXRiqlWaZ3P5ecN7vHvpMBMcEDM4wcIdC8M7cA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796118513; h=DMARC-Filter:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=2ny7QRAdHvygVfN4Wj/IWABOLFxK8eyFAbrtRmg+wRQ=; b=kdEeUaHCecNt8jdpX8aUze11LnBqQAunLuIFo0+WTgzYWwEihCz5ApBaE+hjOVrnrxln 5Eu/E4zXVt7bBHn5oQ/fPoaOhTPlyX/3UUNYwRWpdX+C3kA6txusk6IZoNIlAK19fCOUH NMP6/2PCDtdXwtGnpvIApLjSPbVNxcdOYIpbcQgs/LbhlpfzgvISvyfy+BI10Yrk8WXQI E2HOKgzcGag3/f9VIHNwnWB/EpMeHdy8GFUokaQe1SDsPf+ZcjlYFfZoEaeG8vZ5tCvUh OQ8EDdlGvayUCylCBKXEEEDFiVMe9Z7HkpP056DPEqPA6DnsHbyB+cMe/w6J2oLGqhw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=sp6WFv5d; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFEFC606A33B; Tue, 1 Dec 2026 09:48:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CFEFC606A33B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=sp6WFv5d 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 0558D14BF; Tue, 1 Dec 2026 01:48:29 -0800 (PST) Received: from e129823.arm.com (e129823.arm.com [10.2.213.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6409B3F7D8; Tue, 1 Dec 2026 01:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796118511; bh=gi7tNZ4VdyEcfq2jlO7BNf9xmGHJFup8YLVRu1tfifs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sp6WFv5dwtp8D20ZnB2y/btL6gkPrB+PBsUez9gYEkzKT5jaP4tM6aMIVcpg6Lc83 6TreTlYDmg5vxm3CUTZZ+IDtU89MokDfDj0jMHBWEBqo4TTuLukHiBsQ6/sul+FQNY TOburUHJngwcQYSvq2OUxRhKM3PKU9O4pxoBuaTg= Date: Tue, 1 Dec 2026 09:48:20 +0000 From: Yeoreum Yun To: Andrew Morton Cc: Yeoreum Yun , Russell King , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Catalin Marinas , Will Deacon , Arnd Bergmann , Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Lorenzo Stoakes , Tianrui Zhao , Bibo Mao , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonas Bonn , Stefan Kristiansson , Stafford Horne , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-openrisc@vger.kernel.org, stable@vger.kernel.org, Sohil Mehta Subject: Re: [PATCH v3 00/20] mm: change behavior of pXdp_get()/pXd_page() in compile-time folded pgtable Message-ID: References: <20261130-dummy_ptxp3-v3-0-456081a8ed0e@arm.com> <20261130160513.b6c6fc2c27f764dc2dd96ee0@linux-foundation.org> X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130160513.b6c6fc2c27f764dc2dd96ee0@linux-foundation.org> On Mon, Nov 30, 2026 at 04:05:13PM -0800, Andrew Morton wrote: > On Mon, 30 Nov 2026 17:18:33 +0000 Yeoreum Yun wrote: > > > Using ptep_get() and its counterparts in common code is suboptimal on > > kernel configurations with generic compile-time folded page tables. > > By default, ptep_get() and its friends expands to READ_ONCE(), > > forcing the compiler to emit a load even when the value is not used afterwards. > > > > lazy drive-by comment: > > > Documentation/mm/page_tables.rst | 84 +++++++++++++++++++++++++---- > > arch/arm/include/asm/page-nommu.h | 4 +- > > arch/arm/include/asm/pgtable-2level-types.h | 20 +++++-- > > arch/arm/include/asm/pgtable.h | 2 - > > arch/arm64/include/asm/pgtable.h | 23 -------- > > arch/loongarch/include/asm/pgtable.h | 2 + > > arch/loongarch/kvm/mmu.c | 20 ++++--- > > arch/mips/include/asm/pgtable.h | 2 + > > arch/openrisc/include/asm/pgtable.h | 3 -- > > arch/riscv/kvm/mmu.c | 20 ++++--- > > arch/riscv/mm/fault.c | 52 +++++++++++------- > > arch/x86/include/asm/pgtable.h | 14 +++++ > > arch/x86/kernel/cpu/common.c | 2 +- > > arch/x86/kernel/machine_kexec_64.c | 2 +- > > arch/x86/mm/dump_pagetables.c | 18 ++++--- > > arch/x86/mm/init.c | 2 +- > > arch/x86/mm/pat/set_memory.c | 6 +-- > > include/asm-generic/pgtable-nop4d.h | 54 +++++++++++++++---- > > include/asm-generic/pgtable-nopmd.h | 54 +++++++++++++++---- > > include/asm-generic/pgtable-nopud.h | 56 +++++++++++++++---- > > include/linux/pgtable.h | 69 +++++++++++++++++------- > > 21 files changed, 369 insertions(+), 140 deletions(-) > > afaict, this series is an unquantified speed/.text improvement? That's > a lot of churn! What actual benefit are we getting from it? Actually, this patch series is not expected to bring significant improvements in overall performance or .text size. Rather, it is a preparatory step towards replacing direct page table accesses, such as direct dereferences or READ_ONCE(), with the standard accessor pXdp_get() [1]. Therefore, while there are no significant overall improvements or regressions, individual functions benefit from the removal of suboptimal code. For example, on arm64 with CONFIG_PGTABLE_LEVELS=3, I measured the performance 10 times using perf after applying this series, comparing the results against mm-core/for-next: +----------------------------+-------------+------------------+ | function | size change | exec time change | +----------------------------+-------------+------------------+ | perf_get_page_size | -3.00% | -2.10% | | walk_pgd_range | -1.37% | -1.70% | | __apply_to_page_range | -1.23% | -0.23% | +----------------------------+-------------+------------------+ Thanks! Link: [1] https://lore.kernel.org/all/0019d675-ce3d-4a5c-89ed-f126c45145c9@kernel.org/ -- Sincerely, Yeoreum Yun