From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796231308; b=I9lQapgvnWprttlfOzBj170120ObSsq0PZfVKpbA7vkFkK5MsTjglbQv7RvrJwAgDrsz lxDTm5WMUbvlu/2lILYQMpAU3q/yCGunj4YgJS7R+Fq3/EOZswr2NFCqxLe9t7NHOvgEz W7X5pzItp9VoUME9BPSwWDUjrHTrLqVGG67rV54L5IfrFWSsKdCqjlaDjpys1NDeplaWQ XOrTzjr9vaSHvxjZf4aDThEB1v31n6h6NZMhV4Kilt0K3USbfj8XwOvPhVW5fvJZMWrxf vwP4J82+IId2l4YV8hViPAgaJVQVPJd6K2FZs+Ba0k+eaGikB6HXRoEbFW1ghgIq/FQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796231308; h=Received:DKIM-Signature:Received:Received:X-ME-Sender: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer: MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To: References:Subject:Content-Type:Content-Transfer-Encoding; bh=bjXUh/1d9+wOvSdAbzighq0usqxKuzYrm3vMObz36bg=; b=c77rK3ZIprPCId0ie9W0Gs215F9S/0SLZCD3ugxaCx1gMjo2S0/lOhwX7lr5AnNaY28r 23kZD/C9yHmdA7Ii97qG2GSf/8g8o2wL8Hz87O01AX+vdJmlXPZTtG+5n6GhzM7Lj+9aL G3VK6ntfLxYW9/RD42i6ZYpNmoTEkc84sHF0RhI1sOp2Xr2IJv2Y22xgYjV7htxrbuABz xuXyVTDH+4AUNrfCPeYGYaIW8MP02JJ+SIIyj6vpiA46PJK3niiRaauF/Ec85/Fyqm90l Cf6mRoAu821Y9LGtSKd1Nxp6CfUh0pSwjDGtOSm21zYExl5xEYP3CBRFc67ado1kFFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Ph/81+Hh"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05024606A322 for ; Wed, 2 Dec 2026 17:08:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ph/81+Hh Received: by smtp.kernel.org (Postfix) with ESMTPSA id A90481F000C1; Wed, 2 Dec 2026 17:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796231307; bh=bjXUh/1d9+wOvSdAbzighq0usqxKuzYrm3vMObz36bg=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=Ph/81+Hhs3QXwZKUsKRMzvMv5k8XamRVXC3IFFB4qICcPWK4HZqGfSrbSvlaHo8jx p7ka11gDRd4d4uZFmfQ6sxk6VAZ/lzTXghH+iyHHLgp+NZkJK8fOumpdkTzeIaxKmB 90jU432+zQ1E4RIGo9a3cxyPxjg8pVR9UtjZcv6NyM6ri487p8Tn8TbJUh3xZHE2FW 3X9nD4V9UQdovmQzP5jsBldetMuu4lMJc1Pks/X2lofan8zqEXhf1bGJIPAmYsywIK zD8eIeeuDjnIO+0BveJXbzytKABrVpnVKThx1GvJOIs7eqwmB3T7Ft+k2iBiq858K1 Erw9S4kK4mq6A== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id CAB69F40068; Wed, 2 Dec 2026 12:08:25 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-01.internal (MEProxy); Wed, 02 Dec 2026 12:08:25 -0500 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFnWeexYtSl2gGQ4p63WzUZ6v3sioE6AVyWLCcadB6lxq4QPjGoD4PS6UoEFWAcvc 7zf+KetUEw6PopQRa3tOx+ACrIOtczJ2k7eJj/1v5h4D7onTC8l2lJDweXfYmL67mOEubU FdSO5d3RMNHr0DgrYNUSLG8nAgc9pCJFMvhViHWyuGd9I7yg/G8utypdn1SuIhEVByHAkP h2hIo9oTG3vj3tCbn3qiojvOSBqfKV/FLrWLQYOaQxHHNxJIdUlUUpBYj63PWSJNq8ZWd0 r0aWU/rtwMYtESLCYe9srwfY+2x3NpnMF89LZbtTfPZpZyLFdy+/KKCMrg4VWq/CXJuYFL AR0pU3fzn/lTnsGAG3BelzbjzUjDDA+LKu5d4UPR1KkOC07n5tu3a0ZYEwIAbKapSO/AHI sn79umlP+OmNpzGbyjpshELtSj7AlwL0DzcN0lY1QzP1AmmsaY6UJJWvaFSk5aEbQMfpRB SVar6y9tFyxWKZOMY+kfDg62sRMkRqnOMpY7GJSjJqzgZBpVjVuZ9V6t1CvOFb+5opi3l9 e8K1roKqSnJkZ6DH78fLZi8XXsknvHn1SxTjgft2sIQRyJZ3BHHWIl/i/hMmphWeT3gTc9 FeiwgZxVXsU2pwrBvJ3nU78yBDlTwtYA4foUaZnZ5FsNAOllHjqP0JdpIrOg X-ME-Proxy: Feedback-ID: ieff94742:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A0D5F700069; Wed, 2 Dec 2026 12:08:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-ThreadId: Ag4FU-lxcIVg Date: Wed, 02 Dec 2026 09:08:05 -0800 From: "Andy Lutomirski" To: "Valentin Schneider" , "Linux Kernel Mailing List" , linux-mm@kvack.org, "the arch/x86 maintainers" Cc: "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Peter Zijlstra (Intel)" , "Arnaldo Carvalho de Melo" , "Josh Poimboeuf" , "Paolo Bonzini" , "Arnd Bergmann" , "Frederic Weisbecker" , "Paul E. McKenney" , "Jason Baron" , "Steven Rostedt" , "Ard Biesheuvel" , "Sami Tolvanen" , "David S. Miller" , "Neeraj Upadhyay" , "Joel Fernandes" , "Josh Triplett" , "Boqun Feng" , "Uladzislau Rezki" , "Mathieu Desnoyers" , "Mel Gorman" , "Andrew Morton" , "Masahiro Yamada" , "Han Shen" , "Rik van Riel" , "Jann Horn" , "Dan Carpenter" , "Oleg Nesterov" , "Juri Lelli" , "Clark Williams" , "Tomas Glozar" , "Yair Podemsky" , "Marcelo Tosatti" , "Daniel Wagner" , "Petr Tesarik" , "Shrikanth Hegde" , "Dan Beimborn" , "Pak Hung Vincent Chiu" Message-Id: In-Reply-To: References: <20261127201221.434876-1-vschneid@redhat.com> <0ec10a62-c496-431c-a6e4-158b2c9a9a6b@app.fastmail.com> <35f7bf0d-651a-4d90-b0af-b4daa53f1f8a@app.fastmail.com> Subject: Re: [PATCH v10 00/10] x86: Quiesce text_poke() IPIs Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, Dec 2, 2026, at 2:43 AM, Valentin Schneider wrote: > On 01/12/26 13:31, Andy Lutomirski wrote: >> On Tue, Dec 1, 2026, at 3:13 AM, Valentin Schneider wrote: >> >>> >>> Although now I would just not store anything and have a single, >>> always-run-at-entry catchup sequence (like the CR3 RMW). >> >> CR3 is slow. Even SERIALIZE is probably pretty slow. >> > > If we can get this enabled iff NOHZ_FULL is enabled & in use, then making > kernel entry a few times more expensive is fair game IMO. If implemented cleanly, my suggestion will boil down to: u64 work = read_clear_quiescent_bits_unquiesce_rcu(); bool serialized = false; if (work & TLBFLUSH) { serialized = do_deferred_flushes(); } if ((work & SERIALIZE) && !serialized) { serialize(); } read_clear_quiescent_bits_unquiesce_rcu() is mildly complex, but I claim that it can likely be implemented at the approximate cost of *one* MFENCE and/or CAS. The entry into quiescent mode should be a single store-release. I think this entire sequence will be cheap enough that we should seriously consider enabling it unconditionally. Or *maybe* do it heuristically where we only quiesce in the first place if we think it makes sense, but I think it should at least be compiled into the kernel unconditionally. If, on the other hand, we don't unify it with RCU, then we're starting to multiply the cost by a factor of at least two, and maybe we want it to stay conditional. Yuck. FWIW, this code can (I think) be fully shared with the RCU idle EQS code, so long as we can make the same promises about vmap in the idle path as we would in the userspace path. That should be possible too unless we have truly stupid driver code, and that's where objtool would come in, I think. --Andy