From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D97237996C; Wed, 9 Sep 2026 09:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788945340; cv=none; b=ZWyiZxkCPPTjoGO0D3E1Mx9qPf1ftYMQaBzLXEXvND8qWB1G2gKqgWIdLDJ/cWrcFgE10R4AmtItK8+eE+9RmsyUySaoMCxlZUswO47KWxz41u4jFc+BqFZLmliz9a7e9VQrIRewuMZUVLQkcTHyK0YZHSH9ONFwA/ZwE6uGTU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788945340; c=relaxed/simple; bh=JTc8DHP/qtDcpzr4d7+FejFT4BPaNW9X2BggCDjy7mo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QdmC0yBR+bfGd5uVgD/g49zFm0VUChkXg5RXWYLBRZE0MxM0JPrENWge17ebijvVCtEajzyFkV5fwRuKzWX0b2cHmgyKfugK6sPQIM1pC0mnXhHFeVxaKmQLvWNGx6LjeLt0c67Ux39OC8x6DS96aJe0yvTGa8ne//wERFBVz0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pc0mftNO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pc0mftNO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E7981F00A3F; 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=1788945339; bh=WMLhSTvOXcO1Feh9yCp+cQisLkpmflOTkHs5UzK+oYo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Pc0mftNOGdEc0Jfw1CtI27FfIQdaxAWsEoGtS00NSboMWgpgq6kMB1PacEkMsCWVE PyBSbte/xncgLgVpiZhfgsZGVbt+xRz3Hc8kbcATJH7G3L2lJ8aalj/R+Aqd6dmX5b 5eg5id4TZ80FMMxsUU2JhjgG1tYJRqytdCJUhIr89SM9fK++Q2AG0nlQDtmg/8dhUN 0IyRNrUW4GQusS5tQLUvQke7ZfU0WLTad249E94UR52ddvrJGL2nfYN7rtII5ZqTNh iI75Q95afgEguW3TjBoNFF2XDSC2ycRoFQVeNeDMOy9GE8TTAngS8Q4tHYSzej4vlC 2tOKgwOhoDyjQ== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260908-rcu-pagetable-freeing-v2-11-1f60b64e878e@kernel.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