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 8C263C98314 for ; Thu, 24 Sep 2026 02:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i3rUJrOssAsIlzaIbpG4p7ewG7Kkt+KPljgikjsMoRc=; b=r5UrusTPPDC1upZhcl2eYPZFyk JM85HgHvvlWqnvAi/7qw1oAXoPQ/fMUIwWPiZ79SFSN6MdlxT+jkQA5w18EQ82JCbnHvG0Pg4hA/k KLkDYgebv5Y8eUWOMW9Q3qqUzc0PxU5Q8cy4nwyZcrcZE38CAF9yT/FndEHkDo+TyALttTavZTe5h gDeZ7oKvzi5qyKqXmvzD23yGUekz0OYP2LZUu3I5/1/ggL9kcibxsl5qImNrO67z/kGiLDCu+av4m Ufj6uhj8I4gODET/N7cj9SxwN0U35CZ34a2ubiu+jGplsIUspn1qhbTuZ6OrhmxN29IqPaVh+w5dE 4XtWPydw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9Zd5-00000009uBN-2SI0; Thu, 24 Sep 2026 02:56:11 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9Zd4-00000009uAb-1XNy for linux-um@bombadil.infradead.org; Thu, 24 Sep 2026 02:56:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=i3rUJrOssAsIlzaIbpG4p7ewG7Kkt+KPljgikjsMoRc=; b=f4edxevjpZYnZqHXKDm3h69SXx 5iLYUKyiJV7wyAtfZRpRVV8mtfk1rTtxdU+nX/iIrlglV2+oz4bW02CiBC3s0SADNzU0bdaLbPlop T14XYZyQGyS2SnyTw+0tzDBY4PZvip2NRsDVa2ltj+d/wZVSjaSMGU9WIjOO0H8f3TQT7v2aP39I7 9ZT+G5bim9mttK/D8tcqMvIxEeZYP0VnwU6um5+cYIGvEMwAlsZ+DfjTV8ATtefV6ucoJcQsURJvY +4jgCmWybAUmjN+7rCU02k8UDJyLmRBZ7QxTfFhTULd6p1wyHbAiYeyCPDX8ff9LIO6oOaeIs7YHp AGxM1JmA==; Received: from out-101.mta0.migadu.com ([2001:41d0:1004:224b::65] helo=mta0.migadu.com) by desiato.infradead.org with esmtps (Exim 4.99.2 #2 (Red Hat Linux)) id 1x9Zd1-0000000FU6j-2S0c for linux-um@lists.infradead.org; Thu, 24 Sep 2026 02:56:09 +0000 X-Envelope-To: linux-um@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=i3rUJrOssAsIlzaIbpG4p7ewG7Kkt+KPljgikjsMoRc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790218565; v=1; x=1790823365; b=FJ7/xF8oprsisbwcodDJLWAHP7xU6j8AVwzm+rHeNENGuQgZQfzLB248rjSRMet32gjO3bH4 zNIpSHuNGIwiwTY6eWVZZZBJaea/kA8QAGJicBdT52+8hp9Q97WWSAToBoK7MTW9xJn7KF7hBH4 cJk4yUvxnIRZ3vhwrVwt5+iE= X-Envelope-To: linux-um@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id 9cade30b803883cf; Thu, 24 Sep 2026 02:56:02 +0000 X-Mizu-Trace-ID: 9cade30b803883cf X-Migadu-Flow: FLOW_OUT From: Lance Yang To: ljs@kernel.org Cc: akpm@linux-foundation.org, david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, liam@infradead.org, nico.pache@linux.dev, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, usama.arif@linux.dev, kas@kernel.org, guoren@kernel.org, bcain@kernel.org, geert@linux-m68k.org, dinguyen@kernel.org, schuster.simon@siemens-energy.com, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, dalias@libc.org, glaubitz@physik.fu-berlin.de, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, linux@armlinux.org.uk, vgupta@kernel.org, monstr@monstr.eu, chris@zankel.net, jcmvbkbc@gmail.com, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, peterz@infradead.org, davem@davemloft.net, andreas@gaisler.com, richard.henderson@linaro.org, mattst88@gmail.com, linmag7@gmail.com, catalin.marinas@arm.com, mark.rutland@arm.com, chenhuacai@kernel.org, kernel@xen0n.name, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, deller@gmx.de, maddy@linux.ibm.com, mpe@ellerman.id.au, chleroy@kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, arnd@arndb.de, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, jgg@ziepe.ca, jhubbard@nvidia.com, peterx@redhat.com, ysato@users.sourceforge.jp, shakeel.butt@linux.dev, corbet@lwn.net, rdunlap@infradead.org, 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, hughd@google.com, qi.zheng@linux.dev, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 11/12] mm: make userland page table freeing RCU-safe Date: Thu, 24 Sep 2026 10:55:56 +0800 Message-ID: <20260924025556.18719-1-lance.yang@linux.dev> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260922-rcu-pagetable-freeing-v4-11-fe1ad1f1e303@kernel.org> References: <20260922-rcu-pagetable-freeing-v4-11-fe1ad1f1e303@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260924_035607_812798_8CF60585 X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org On Tue, Sep 22, 2026 at 04:35:42PM +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 userspace page >tables are 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. > >This is all that is guaranteed, however, so naturally it is still incumbent >upon page table walkers to ensure that the page table entries are as >expected. > >Acked-by: Kiryl Shutsemau (Meta) >Signed-off-by: Lorenzo Stoakes (ARM) >--- with David's feedback folded in, LGTM! Reviewed-by: Lance Yang