From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 101943382CB for ; Sat, 12 Sep 2026 19:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789242060; cv=none; b=fhMXkrMbzZYxq8a5ODvDdXApJ14JrQlIzEqvceHjv6cCmv987v3DC06hq1/dxQTRycPOO3wehUh+RFu3v+lyMSh5Xo4GQUraEF5BwYxJlY1dTgOmpL82K49zo/D/mvwxQJbAJ5rKt9Oo1w83ASFX4FC8qKBqKmNHC9Pe1a+x8y4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789242060; c=relaxed/simple; bh=Fg3k93J+NnauWx+3Z+BYbTT2WHUzh/cuAEcclS6y3ms=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=H16RVmCxE3eSmQVjioNUHKaDlwr4/sJR3MH51Twazhe7/0xNi59ARXzeFCKXZtHfGUo2sYAuj1YYz4tDMnaTqEUT3kg9PPYNwS6/YlS3sCy8bGAvduW/icgmt6oMGeuEXbxdrpFOsDfJFyq6rf+12yij37pU8EoMedAJ/SdetbU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hdL8Tpdf; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hdL8Tpdf" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-6c1983dfaffso1229182eaf.2 for ; Sat, 12 Sep 2026 12:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789242058; x=1789846858; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=/mW9uIl4IQ84J3enCrJFqvgB+YMh25zxbJWRDQHZcYo=; b=hdL8TpdfrOnsp8icWzp7H9iP1o4b4ff7BeOjoL79h4VOB7Mi6IPUtkUAsdZtSvGWwY G5S4oixFN/qeznuCur5B4gc2bSVe1MLjnzZkQ7sCtiMWHNDvIpW7Njy83RaekEGJfsR8 uBar9fpNP8lY8JkBGfS5tr+LkGAtKGPJe5TmeIp8OLJfC6ZUfW1aY64veWs450nV/hiG lAAeDTT4Nb6gB9crfFPc3Hnu0lUOghQtcutwfJGRfdY/gWa0Rle4PGL5cYr/WxeqduxL t9HwIy3rA8i+vi44eDI2IZZE+xh853xSBvG4vdqzZ5ApW6bDRml9lMb+xYwImLjcHGLM YUyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789242058; x=1789846858; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/mW9uIl4IQ84J3enCrJFqvgB+YMh25zxbJWRDQHZcYo=; b=JtiMs0XRUuxjSSmIqFkgX6bcBWTnvnPKtOs9xYtBVpfuPqpTQU3FK1dSlWKgWNvQ6c t6ZTQ5xWcM0iTR4U8UcTmqqrVPXgEN5SK9U21vaQrR0+nnVDCkfxYPyuJNVU62Yzlw66 zkC1SUYVqRWCwoCvpGiOXd3bxvXT7dwipi/b8Yvl17x/TjL4aUmHjGjP3YtV5UWou0qU Repv8ZmQJ1BlQDUCEPMqWwGbwDuQu9ztoRLBVX8CHrckjJdtG5wPvF+lTHIFqOf3aLu7 bMhS6NouQoX55FVRtWmV8k4Vi4ZySdvEljeQoytUbLTeckBrHvwH2qgPdnfgLQQ0kijt sWkQ== X-Forwarded-Encrypted: i=1; AKwUvBwi68kR7/C7LGjaG02LnymI66tjguKenN95ZuI1ck/KRq8XcN4Rs7M3kU/eZv5HVyTtz0f7TEbv3P9JEVk=@vger.kernel.org X-Gm-Message-State: AFuF++kzS45FmshM5YKJ3Br0E5rHnVkgM/aCCCCIMkB2pzFu/cVJ+ehm uP2vc0q0jK3R5tECSsrxpBckKITW1l/C3fTMXPwPVF1Dz8jvwtI1DFYp X-Gm-Gg: AYBFou0Cu91uyo/+2ombWJ5vN0z4yXLfYRqBvBp9OyUjpBeVw/yQoL4TnfQO14xdaUi pXTunau5fLrjVbyPlumidLt4eMwM/H1CUt6getetJUp+EWmJZK3d6JqPbSz2MqVK/GjivdaEdUo OnWnuJnz0nTYfMbyAIIrdwA7yZ0B9dKferCalGtMmPQ+q4Qbv/Z2Qwql3sZ2JF9Imc+boMT52R/ 1a41sK0IrQYmvjdwIM1sIGepaBgvmPJw0AJHIXWt36EL8xo0hrXL//FwdfhqnrgK9nopSpV/kN6 NwC5LnEMyTe5B8ufgwecitFl2sxid052h5Hsi3y/fqWkwP7NwM8JXmOCgiiFydXhYbGHopveAfR nR9sxlPYjXo/9bcUF1JCH6mHwOZrTMupYhPa8DNqyX16dbvqRfh+aoSssoBkxUYcAcU2fKhibUn zkVkPF9TyGcozXb+HIAkzkdyguNJxMtM04CiFKPPU4FFrFOPNFUocCmd6WzznRALsnEdrgjRvm6 tC85OUICYOay/3eDDijDiIpxeJpElhrmVmMl41i70yBN5w4ryWK+1tS8FfSo4RyirI+WE74rVM= X-Received: by 2002:a05:6820:f034:b0:6c0:c954:e534 with SMTP id 006d021491bc7-6c0c9550c4dmr5760632eaf.38.1789242057820; Sat, 12 Sep 2026 12:40:57 -0700 (PDT) Received: from localhost ([2a03:2880:10ff:5::]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6c0996dc5a6sm6404372eaf.6.2026.09.12.12.40.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Sep 2026 12:40:57 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 12 Sep 2026 12:40:55 -0700 Message-Id: Cc: "Josef Bacik" , "Frederic Weisbecker" , "Neeraj Upadhyay" , "Joel Fernandes" , "Boqun Feng" , "Thomas Gleixner" , "Peter Zijlstra" , "Steven Rostedt" , "Masami Hiramatsu" , "Mark Rutland" , "Jiri Olsa" , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , , "Catalin Marinas" , "Will Deacon" , "Puranjay Mohan" , "Xu Kuohai" , "Andy Lutomirski" , "Josh Triplett" , "Uladzislau Rezki" , "Mathieu Desnoyers" , "Lai Jiangshan" , "Zqiang" , "Juergen Gross" , "Luis Chamberlain" , "Ihor Solodrai" , , , , , , Subject: Re: [PATCH RFC v2 08/15] bpf, x86: Maintain Tasks RCU trampoline nesting in the BPF trampoline From: "Alexei Starovoitov" To: X-Mailer: aerc References: <20260911-b4-rcu-tasks-preempt-qs-v2-0-eaaa61ed2da4@toxicpanda.com> <20260911-b4-rcu-tasks-preempt-qs-v2-8-eaaa61ed2da4@toxicpanda.com> <14cb8a91-497d-49f5-aa20-c6cb8b9a27fc@paulmck-laptop> <8c51a669-eb6b-455b-a829-b537da5209f8@paulmck-laptop> In-Reply-To: <8c51a669-eb6b-455b-a829-b537da5209f8@paulmck-laptop> On Sat Sep 12, 2026 at 11:03 AM PDT, Paul E. McKenney wrote: > > In the old kernels, yes, we have current->trc_reader_nesting++. > In the newer kernels, Tasks Trace RCU is instead implemented in terms > of SRCU-fast, which instead increments per-CPU counters. Which among > other thins is a bit faster and does not need to hook into the scheduler. old kernels? I'm confused. rcu_read_lock_trace() in bpf-next is doing t->trc_reader_nesting++ and then calls __srcu_read_lock_fast(). Are you talking about some RCU branch that you target for next merge window= ? > > So we have several ways forward: > > 1. Revert the implementation of RCU Tasks Trace in terms of > SRCU-fast, and use the existing current->trc_reader_nesting++, > as you suggest. > > 2. Deprecate RCU Tasks Trace entirely in favor of RCU Tasks > augmented by rcu_tasks_trampoline_enter() and friends, as > I was suggesting. > > 3. Implement rcu_tasks_trampoline_enter() in terms of SRCU-fast, > keeping the speedup, and put a synchronize_srcu() in the > RCU Tasks grace-period mechanism. This again deprecates > RCU Tasks Trace entirely in favor of the augmented RCU Tasks. > > 4. It is always good to explicitly state the apparent status quo, > which involves redundant trampoline entry/exit overhead. > > 5. As always, your additional ideas here! > > Thanx, Paul