From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (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 E13283C1986 for ; Wed, 21 Jan 2026 19:44:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769024677; cv=none; b=HFefCKiHaHotcX0VHGZBScXWMnqS9FBhAFMdHeDrJt6gmfbTYIz4Cs9HEikcqwEjo4FgBNq/q2FN8CPjdCpgvXJpyJzVAWRP4rTB6i4WZ+j4OwBRktT6b53x2uLro9AjYP7SC1uNNpDhXYW5aU8UuABcdY7YRaCLHrqQ0LU8z2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769024677; c=relaxed/simple; bh=l5SyFJCfo1fQSa9mU6zNAv0ThOth/LCY4pXaeqqK6Go=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oIfYUfXPnY/300PT8gN9G3jQ0lRBml1qOOCBKvTaFgPbgmt1hJxtp34z8Tkg/8jIAkBReIGhPClRd8VbO0kJZD3xvrEQwhpBRQQkbaKwxtoO+R8buy1JBwt+4vv4wzNeJEaDYOom9Y8oiiPeNbN2gcesCZAAFg4RxAQJTo1tCO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com; spf=none smtp.mailfrom=mojatatu.com; dkim=pass (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b=VDx4IwOV; arc=none smtp.client-ip=74.125.82.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b="VDx4IwOV" Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-2b0ea1edf11so513791eec.0 for ; Wed, 21 Jan 2026 11:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1769024673; x=1769629473; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KEa/Pdcnys+mGuP+b9JWKh6Y2RdyW/MdUrzTT9ml1Mc=; b=VDx4IwOVByoLhrAnSWP/KTgkljRYom53Maconcs0m2JH5yAV8OXYCONgsaWZiFCE5A 1TZOTDFja3sRw+UK8aJJcbvvC3779tVdB/m7wE31EbbOutMwNokHiPNiiihub40d7RON yKnPAMXswdZaNjba5hOiT4+CAc7JbquqBGL0BuuT8M8E2URvDBsJlYuGov3q72WNE7Z+ PQu+nZsJ98Dln5jrsN0X5mFuDvKwu1q+uz0+X2j9hhNKb7CX+kXqxnvXA/vL0fBokcrz gr62hOH8kxyRz7sflIMVJDbwA4B+81e3c45UZg3+TQX3SjwsBjPLgVKDCHApPx48EgfO wjJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769024673; x=1769629473; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KEa/Pdcnys+mGuP+b9JWKh6Y2RdyW/MdUrzTT9ml1Mc=; b=EQOLnGDVTNsKbNkK3NUriNyXDDhz92quHu7p7MyPbzZt1T0T/NVZa42IlA8Mt56sHD xGavb+iPwIa6ovrP9oZDl7qPD3DiKuB/ds68NYLTsW66U00meJ4s+YHUA6KL7MaLlihV j9IufM6Wng9pFgeG10SoIEpoxIRXb7ei3g/6bYVrZMRFs+9NHtb6JqouKqLh280qviwY 2k2wHPIhu4iAAcgW0lshD1zUeHq9TuvkojZJ9PrkiahMqg3W8va4eIyDbhyNoadmFFCc o8xVBVATWiPcjKV0kmb8Z09Emncw3FO/MMH0PAAso4PT9IUHg0BDuXu2IXfQHX3/7YtU s4nQ== X-Forwarded-Encrypted: i=1; AJvYcCWgue91VhHl9zHKB9icnpBJyz1ZD3V4imRAX3MBt6+V/U4+6MXWngw53uVOX/dc6az4oat+RzN7gNDMFck=@vger.kernel.org X-Gm-Message-State: AOJu0Yzc6l5ePi0W8siPn6HSDF8NMAN0EJJPppRbzyNfU7JWM2wO5/lP nJqL4Of16gC8+RhLkQ5mZbUGSF2jrTJYcbUA61znXLRvvXUTMOcZJQr0l4U+GFgw4g== X-Gm-Gg: AZuq6aLgPNGVKUwsKVfnoCb0y/hiXFFL2ZJtMyDEsoCAd+pDKr8/+0sOPB0f1mTXpgl Twc8UiyR92cudYuyFqgbFus09Lf253PBMwaGuKlOJ22xwQ4GPV2MPHwFjMlpCOyhi8/bTnsxC5m MFUs/2ktdfgxskwpcx5NHDX1Z8mJDzQ/syBcE98rPXQC4+VoLEUc2s2Fl96nIEPIDB9JOVAku7q iTmkBn6dIBIy+9UEIrsxsL9z/elEF1+/DDrkEcbaiZ2yArJk6RZpIGoslu904LwGZDqIFCgktGX bs0FkSQwP6lvBnChseODUt+2/Jkt0dpaZ+iZse4nsrm3stwCf/TDdyAbzivaRVPwdz97z1GVBrZ xzDVe5l02Y6jd4qLdYMkTnEUoWkM18AT9/C3i2kphQ6PkbW/vPuOwvQRQPvkLFV7hgEJLEBe5M9 gSY6MgqUFk9n98VLU584NDiQ== X-Received: by 2002:a05:7301:408c:b0:2b7:143a:9a8f with SMTP id 5a478bee46e88-2b7143a9e6bmr1628457eec.7.1769024671502; Wed, 21 Jan 2026 11:44:31 -0800 (PST) Received: from ?IPV6:2804:14d:5c54:4efb::1c9d? ([2804:14d:5c54:4efb::1c9d]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b71d3d2da2sm2106569eec.6.2026.01.21.11.44.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jan 2026 11:44:31 -0800 (PST) Message-ID: <1f63d057-ce11-4fdf-b9d4-7022ec356377@mojatatu.com> Date: Wed, 21 Jan 2026 16:44:25 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v3 4/7] net/sched: act_gate: read schedule via RCU To: Paul Moses , netdev@vger.kernel.org Cc: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260121131954.2710459-1-p@1g4.org> <20260121131954.2710459-5-p@1g4.org> Content-Language: en-US From: Victor Nogueira In-Reply-To: <20260121131954.2710459-5-p@1g4.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/01/2026 10:20, Paul Moses wrote: > Switch dump/accessor reads to RCU read-side sections. This matches other > actions that read params under rcu_read_lock(), e.g. act_tunnel_key dump > (commit e97ae742972f6c), act_ctinfo dump (commit 799c94178cf9c9), and > act_skbedit dump (commit 1f376373bd225c). > > Dump reads tcf_action via READ_ONCE, following the lockless action reads used > in act_sample (commit 5c5670fae43027) and act_gact. > > Timer logic stays under tcf_lock and uses rcu_dereference_protected(), keeping > RCU readers cheap while preserving lock-serialized timer updates. > > diff --git a/include/net/tc_act/tc_gate.h b/include/net/tc_act/tc_gate.h > index 05968b3822392..9587d9e9fa38f 100644 > --- a/include/net/tc_act/tc_gate.h > +++ b/include/net/tc_act/tc_gate.h > @@ -57,9 +57,10 @@ static inline s32 tcf_gate_prio(const struct tc_action *a) > s32 tcfg_prio; > struct tcf_gate_params *p; > > - p = rcu_dereference_protected(to_gate(a)->param, > - lockdep_rtnl_is_held()); > + rcu_read_lock(); > + p = rcu_dereference(to_gate(a)->param); > tcfg_prio = p->tcfg_priority; > + rcu_read_unlock(); These helper functions are called with the tcf_lock acquired, so you don't need rcu_read_lock here. You can just do: p = rcu_dereference_protected(to_gate(a)->param, lockdep_is_held(&gact->tcf_lock)); cheers, Victor