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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 3D0CEC79F8C for ; Wed, 9 Sep 2026 09:15:44 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4hfwC24xzTz2yps; Wed, 09 Sep 2026 19:15:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788945342; cv=none; b=Mke1kweRBOWOdSJacaOo/yBZCbnLjD+KFjmvM20oPh+Pt9BwZjeyMbHNDEVEvxof9liMmsSq4UMsohqm7BWZ5KsF+CTpDIlp1eMQLosYHTkhjQD1VB2fQS/q7AgmpkGu3hfpjlk1bsW0kSqJ+QZI97Y0dW3O8HPeaOLiJUnDZaypZ91bljgjrsV9xHWCbGwLecqN+0o7zkT74gett4Xiimu+0GNtZvimmHjUTzL7iScY/L/eVbU2uzmt8YlBN7GJvwgInlQg/o3nwwDS5OU2ui2M/L+1aBFMt4JFp42b+blpMeuNOOl5eulSPBXyRRJhGt8OnQn/ga0Xj+9PuIxALg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788945342; c=relaxed/relaxed; bh=WMLhSTvOXcO1Feh9yCp+cQisLkpmflOTkHs5UzK+oYo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VxG9qoMY+4MMxFyOvaGx1Reuc1cWWQbp4msIK+dCdYmI8VsggbWQOK1wpJWOmhObM8pYol3r15b6vuw74LUTUaw4d6jBlBRWNS8/gkFe+WDVq6wZX40K293Rj93B4LrX59dhkYkf4pI7ApcloDcEDLljiBzAggsnQtwYkQ/+L/0Jz2VuAJT9vdRRXKXTC1EqRUnxH/iEDPaRm6VlZdZHUQpY9CPaexxqzlV7j2MeKVkktZMw3VY0BQtm/8cdBKe4jpQZfS24OK1W8GVamioEwWhE+ie2QKS6/QHqFG1dSkb0APi1RoUTD2h4apn6NcmIcJEQjpTf9mAnpVUOWpuJwQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZBusIWCN; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=kas@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZBusIWCN; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=kas@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4hfwC16GJlz2yln for ; Wed, 09 Sep 2026 19:15:41 +1000 (AEST) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 0181C43FF1; Wed, 9 Sep 2026 09:15:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 663111F00A3A; 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=1788945338; bh=WMLhSTvOXcO1Feh9yCp+cQisLkpmflOTkHs5UzK+oYo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ZBusIWCN+P7dXWHhpmFPOV+S3a+1WBjFc8E4Dla9jSlpOPp0YbEw6Gx5JHAhXq1Ox TiXg3EpXaAP3k3Pqd9Bz6g1XDxpukb7hScIRCbuFYzAAE9ZeXJgPoRSVLVkd47S8yV cEgXNJ1BLsteLJG71EFtqgP+7iaieY3+NWjdNpOGfkkQUJzaIqlJ1vr6zii6vaegQU 11zvE33JYF4jAV9m2u1wr+7He/fca+pF80kLQfVQ3aC0AhY7C8DBeR6W0KU4HxftdB CCPlCymrV0JBKBDoYpHbQGkRz8Nvr39d75+CK9q07cmkNuNrc20M//BPHgZMDCN7fz 6sjd1+/lSbqjg== 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> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list 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