From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (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 0F8AB309EE2 for ; Sat, 12 Sep 2026 19:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789242060; cv=none; b=EIP+a9XVk6BsffxosiPT0fxfoYUmggpCNscpSxDZc6Xt7PkvrHr9SuI32mFe9hAQnx4AtbHR7sAdE9LsbcfqkydEzrm/YhxapFLqZIXXFUTsv922jpdXJ0+juUn4sWHcIA+CpoqXhkyRhQ91ClUh6hTE+NY07I+qG4Jr0VnbO7M= 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.44 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-f44.google.com with SMTP id 006d021491bc7-6aa9606ddadso1715206eaf.0 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=OlHJ+3OPYA2FO/6qJGxVcsQm4pO+PZ7XWydlgZ0ogCrIG2erHqaZUtJ2mnpYsfl7lN obOmsvTPEiSkyP0ny+Cy1UwGTsao7q+lw1qSiMmVl82rtarJF4uij/vmetm68soKQudz bnIr0YKHBoc4yw04jY5//9BO0M1mvsJZJuK67eOx2BNl7V18a/P9w812jYo69zZvAl6f uSJclC5DdvikwIupdZupTb4SXgx96X8pYPD6S2z9X+QWOaw8u2t+luihmuPxQFR87fnM qijVrN8b1T8jWfeTgu+S5mo6X3WeY3TBSXYz/f7S4gKQoP4AzyRomjTpovmB6sDnOG76 hpVg== X-Forwarded-Encrypted: i=1; AKwUvBzQW+w+SYjSc53oXAF/se66U7REoXMjtmm3SBiON5KKHz8WufxMxwqbJDQ5//Ld0FwpsBE=@vger.kernel.org X-Gm-Message-State: AFuF++neI9b1O43gPBUs/vJxpUWCrpxxjZPEfKfpWPHfKwkaimphUVCT exxYnDRsRXvFmAiOrTSI0S4Byis8iuAzG7qNfuNH2KbKuNZwAd4Rl1Ue X-Gm-Gg: AYBFou0/Qvht5r6hTgMxW0E9bUxuYPcyKq8Z8S73+raX9DSggbln/5ku+dSrPFkYVJr 5RPHhuQNiY2FhDSVTR8GM31oC57zRRz3jXcunedNfU7dF/AQ3gtyFUDNGvYcsLaT5B3cyJ98QYY jmDnHkbUH00mfra9Ihous/VylQmRyiLRiR6FNK4WwrZe+D6h0YGtRCZEiav8D/65nPGYv4emuek NX5Ug131TGI+eWfu1p2CCEvwc7zRW/qMp7EapCWJ4dNi7I02iJn3D06Wuk8JDwhA8TIh8sves04 d8Jkn+SQ5vEQcKEGiVk7NDxkq6/rSyPWmAJCM2whdrDhGGRDQN3T+kwurM+/SEb3/ilPkIVov7E IWpk5Zh9hioGWQ69rI//iZHNUTgyQNhd3/NAK/xjz1kGdDd/25ipWNn9Fz0Z12xypQ8OnxyimtD JoqP2yoaiFssuQn177JyUJ1gtIZ1JMKh4ng6+CkHpP7deJMVnSWL5hMoN1tkcZhRqgRcCQsyAGh uTnB8CcjVo/VrKUp3t5WdzbJ3gtPl8xDOm9nxXJlOaU2n4Lp6vq1kbSldlbf82T9bnTyTr22UM= 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: bpf@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