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 1022B36308F 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-6b1b3d7f10eso1664177eaf.3 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=AbEXfJU3a4UoxWKMaqvkJBW+cZ5dhlSMDrIrruZRYYEHG0vfxt3wwIzZSBmqM8iwEa o/Es6ScwH9DCXyBKX+vwZzjHtai9B9NjuKxOiXz/Ktq+eDjshijGQ0UwFal/iKYPoLf9 4OOSGde2fNKx+JaBdWkb+9Qg9JKYXylrU0/8ba1YuTGMDWC4/YHqlsd2Z578KS6BiMBa V+8AJV3YaamaqwnxgdYgKaJZ+EQ4RiIF8f48/izboW8NHfE3TLy21xFbpLk1FmUyhPNx ekd+l2Ty9Qp9i6vd01vev6Trh5ZHbK1nuYjaKj8wO4XfELlIdtTW92zC1cM6ifNsUhzo LzXQ== X-Forwarded-Encrypted: i=1; AKwUvBw8aNoTFfF60YwX2gUSPFlH/RKioH1onmN6BbBvsDeVEhM7EwA93KFYfU+FCEguvSqmsjTLelonUHlZ0yKMai8SOc4=@vger.kernel.org X-Gm-Message-State: AFuF++n8vkJHkeINrs2ZzerJapPy8UnfJbf4itn8XsqxbpWpwreWudS0 hIgy8kwN+2fpjDvqgC/KoCJXBZR77RPb0jYRHstCIKdEU5ToWKJd2438 X-Gm-Gg: AYBFou0hOMUcpBTI2TDv4XowaKA2SnwsQVFNUX3Eb66gs96uw1DBIkujZugjbrrHdT0 ItL7ydsg5p5+Uv9wR2L17TMV+jN2jX6CeP39kmwOYiQz0ray9l0BUObEPaBoHpd9XG6EIn4G/2H 2UqgORnYM6U6tbl2po3la8D8pVEayGXU0m5/aHX3TjpTuko4sZ0G65sKaqH+/ajolDKRmhjGVWI QRt6NZopVEDG+6Np2VPw3f7/LW3thHlmMJVbtVopz7Y6yu2NBUBByYUg/8P4FdsObRZ31pk+o4J /ffwq3DqsK+b4zO7niY6c1/GVYM85OX5zlt1xh+RqidXzKQY2A+zxl1GkT2iR1QbiP3iJDnktY3 00o3wNFKBhDU5rLhWiFyJZznWc25Cna1r2scPYlghgLG3+wNOjKXXC7CcEaHfaNP9+tlpMZrtGP 9l99d1stIf/jKnFCKxoUPC0ovRX1ezPeV6jx29cLreGjL0sPkvpwU3IHMaxBJpPXk32snqBe1FA u6oFXl7biX1U2tEmvSfeVEHkYHHlWsp/HPPAtm/nIOJkivdgMQ2hZpmsZfVweLTjnExECh6mZI= 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-trace-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