From mboxrd@z Thu Jan 1 00:00:00 1970 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 9D8FDC79F8C for ; Wed, 9 Sep 2026 09:15:55 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vyqbuj1QsJ0Ju3M94CQBxv27O31YUOdGIulGwtPJ7K0=; b=LKs8MmC4BLwdiM KaEBEzgYyEaepU6sfwNif2bAo5/lkdOQ0AdIS3fGSNFvBSQ1Da8x/zOr4H892+1iZMugxQDR2q49U i81pKSOKzTtxVbgkFMAZOOJYCY+XJ0RGtua3OiSmp386i1VdF41SotxP3Zdo5NEY7jhSbj1ulX4Wa bN7qZHgWTVT9vxDrurOejEV7BksNwsv32xTzu8g6L3LmtQlbNsEAGOs8Q5fgqQgHeZnOg1GzcMx0Z 39D1pYRI+GaKT3C9mYbsVltXog+Q/jgfYh3Uulo3YLaU0fgfIdwbyrld74H5Fk7vA8Q70Lr+jQRg+ onu8Jp7Cxk0a9AABNS+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4EP5-0000000BGEL-3ii1; Wed, 09 Sep 2026 09:15:39 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4EP4-0000000BGCw-09D3 for linux-riscv@lists.infradead.org; Wed, 09 Sep 2026 09:15:38 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 486DE4321F; Wed, 9 Sep 2026 09:15:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74B211F00A3E; Wed, 9 Sep 2026 09:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788945337; bh=WMLhSTvOXcO1Feh9yCp+cQisLkpmflOTkHs5UzK+oYo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=SU92HqNh27RS6YRNx26Rs+KYJrFRZUsd9ZpJBSwjLvvGAKmebEX02zlaZjgEfI0hm UPu4YVa0ehEwEaragBV4dqOPpoQ2oUyrQwP69ZMTVZLTpdqjlmQGv88tuHESgRRx8g i7CyQbm7kgQhdULCEkAl4+mJCL79I/AN0ukKr9R00tM6HjSMMw+wqm3iqHhKIgpu2K slQ1kJEMXHMacSmqRlp2nrsFk4QnnCUxsnpeqV0lRxUejY31L2T9c6ZVOVQnDS0k5g jxLoUETYrDmNjon+2rEmqnpWaOeWbpmKN/tpxVZ1JyXn66/+yoovsc/Lrqi3XvzDXU AJrEhuNBKrVNA== Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.ams.internal (Postfix) with ESMTP id 8E752198003A; Wed, 9 Sep 2026 05:15:16 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Wed, 09 Sep 2026 05:15:32 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFpC8WONluUuvc7dpKb99eg92DQ33MSjEt2sNv2fC237wiMixhMca33e2LldrnTRH U75C+KLC/q/LoK5zKzpXIyjFwS1b+E/++uY5aiYodIxAbg9BZ6O3CC6cd1SXYaFEulw8KR jAI6ffm11DtQZdknyCWUWVFfuLXw2xt2y4TrUuW5CEhhTR/K3eTVLpp8QK1B0crMmfDXeu uwu487939XxAxC04N1S97FZttc+sKd0M0bqZu5+zU/yY2Z2X+w/t7eOM75eiUIDwrFyGW9 VO3+XGBW9eUcOQwzMaEf6se6jBI4E1kU1BTvjozT7XN+z/WzRNjCEoYCcDV/y4SRQAjlN1 UJij+//6ITDtj0vpJtsxh3nZgt0K5pHTh0hy5Hu48Cov+xYJKliDjhUO5TEvuCAqjsq3SO OxyGdCaNbHBZZb7IXgcT+pITOfdPxsCPlJyBoTr8Le9pMNL/ZTHnXi+/DIJXF17DMcWZIh YM5LVoGds+47feWKyzGfEzTv1rFYfFtyh3h/v0wuQgBr2xOdBApwONTAMblqFbOLbUS27j NPYBYul31i/zyEEbO83Lgkbp30doOoaMXPcKhFs3Rw8N2hrubUNjgoPgAP5Spz0uSYcxe2 FDFitH4FhEvRxWxK0irW8E1NKmcImw4MXKQVOJjCI5K3tVhOemySCLVfbAmA X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 05:15:14 -0400 (EDT) Date: Wed, 9 Sep 2026 10:15:13 +0100 From: Kiryl Shutsemau To: "Lorenzo Stoakes (ARM)" Cc: Andrew Morton , David Hildenbrand , Zi Yan , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Guo Ren , Brian Cain , Geert Uytterhoeven , Dinh Nguyen , Simon Schuster , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Russell King , Vineet Gupta , Michal Simek , Chris Zankel , Max Filippov , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , "David S. Miller" , Andreas Larsson , Richard Henderson , Matt Turner , Magnus Lindholm , Catalin Marinas , Mark Rutland , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Madhavan Srinivasan , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Arnd Bergmann , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jason Gunthorpe , John Hubbard , Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-arch@vger.kernel.org, sparclinux@vger.kernel.org, linux-alpha@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-um@lists.infradead.org, Hugh Dickins , Qi Zheng Subject: Re: [PATCH v2 11/12] mm: make userland page table freeing RCU-safe Message-ID: References: <20260908-rcu-pagetable-freeing-v2-0-1f60b64e878e@kernel.org> <20260908-rcu-pagetable-freeing-v2-11-1f60b64e878e@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260908-rcu-pagetable-freeing-v2-11-1f60b64e878e@kernel.org> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Sep 08, 2026 at 01:32:20PM +0100, Lorenzo Stoakes (ARM) wrote: > Now every architecture has been converted to support > CONFIG_MMU_GATHER_RCU_TABLE_FREE, this configuration option no longer makes > any sense to keep around. > > Therefore remove it, and remove all the dead code that existed for > !CONFIG_MMU_GATHER_RCU_TABLE_FREE architectures previously. > > Additionally, CONFIG_MMU_GATHER_TABLE_FREE is no longer necessary, as all > architectures instead use CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE when a custom > __tlb_remove_table() is required, so remove this too. > > A number of architectures only enabled CONFIG_MMU_GATHER_RCU_TABLE_FREE if > CONFIG_MMU was set, however the mmu_gather logic only actually does > something meaningful if CONFIG_MMU is set (mmu_gather.c is only compiled in > this case, for instance). > > As a result, there's no need to gate any of this logic on CONFIG_MMU > explicitly. > > CONFIG_PT_RECLAIM however does have a strict dependency on CONFIG_MMU, so > make this dependency explicit. > > Additionally, correct comments to remove references to non-RCU page table > gathering and make it clear that this is not 'semi-RCU', nor has it been > since commit 1fb3d8c20bfa ("mm/mmu_gather: replace IPI with > synchronize_rcu() when batch allocation fails"). > > With this change in place the kernel policy is now that all page tables are You missed s/all/userspace/ from v1. > freed after an RCU grace period, and thus it is now safe to unconditionally > perform page table walks under RCU, safe in the knowledge that page tables > will not be freed underneath the walker. > @@ -151,24 +148,15 @@ > * This might be useful if your architecture has size specific TLB > * invalidation instructions. > * > - * MMU_GATHER_TABLE_FREE > - * > - * This provides tlb_remove_table(), to be used instead of tlb_remove_page() > - * for page directores (__p*_free_tlb()). > - * > - * Useful if your architecture has non-page page directories. > + * Page directories (__p*_free_tlb()) are always freed via tlb_remove_table(), > + * after an RCU grace period (see mm/mmu_gather.c). > * > - * When used, an architecture is expected to provide __tlb_remove_table() or > - * use the generic __tlb_remove_table(), which does the actual freeing of these > - * pages. > + * This serialises against software page-table walkers, including architectures > + * which do not use IPIs for remote TLB invalidates. Indentation is broken. -- Kiryl Shutsemau / Kirill A. Shutemov _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv