From: Paolo Abeni <pabeni@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Valentin Schneider <vschneid@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@netfilter.org>,
Ingo Molnar <mingo@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
netdev@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH net-next 06/18] netfilter: nf_dup{4, 6}: Move duplication check to task_struct.
Date: Mon, 17 Mar 2025 18:29:51 +0100 [thread overview]
Message-ID: <99214ac9-cff7-4a5c-b439-ed9ec2c6877c@redhat.com> (raw)
In-Reply-To: <20250309144653.825351-7-bigeasy@linutronix.de>
Hi,
On 3/9/25 3:46 PM, Sebastian Andrzej Siewior wrote:
> nf_skb_duplicated is a per-CPU variable and relies on disabled BH for its
> locking. Without per-CPU locking in local_bh_disable() on PREEMPT_RT
> this data structure requires explicit locking.
>
> Due to the recursion involved, the simplest change is to make it a
> per-task variable.
>
> Move the per-CPU variable nf_skb_duplicated to task_struct and name it
> in_nf_duplicate. Add it to the existing bitfield so it doesn't use
> additional memory.
>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ben Segall <bsegall@google.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Valentin Schneider <vschneid@redhat.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
I'm not a super-fan of adding more flags to 'struct task', but in this
specific case I agree is the better option, as otherwise we should
acquire the local lock for a relatively large scope - the whole packet
processing by nft, right?
Still this needs some explicit ack from the relevant maintainers.
@Peter, @Juri, @Valentin: could you please have a look?
Thanks!
Paolo
next prev parent reply other threads:[~2025-03-17 17:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-09 14:46 [PATCH net-next 00/18] net: Cover more per-CPU storage with local nested BH locking Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 01/18] net: page_pool: Don't recycle into cache on PREEMPT_RT Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 02/18] net: dst_cache: Use nested-BH locking for dst_cache::cache Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 03/18] ipv4/route: Use this_cpu_inc() for stats on PREEMPT_RT Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 04/18] ipv6: sr: Use nested-BH locking for hmac_storage Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 05/18] xdp: Use nested-BH locking for system_page_pool Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 06/18] netfilter: nf_dup{4, 6}: Move duplication check to task_struct Sebastian Andrzej Siewior
2025-03-17 17:29 ` Paolo Abeni [this message]
2025-04-07 9:33 ` Juri Lelli
2025-03-09 14:46 ` [PATCH net-next 07/18] netfilter: nft_inner: Use nested-BH locking for nft_pcpu_tun_ctx Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 08/18] netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 09/18] xfrm: Use nested-BH locking for nat_keepalive_sk_ipv[46] Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 10/18] openvswitch: Merge three per-CPU structures into one Sebastian Andrzej Siewior
2025-03-17 17:34 ` Paolo Abeni
2025-03-17 17:38 ` Paolo Abeni
2025-03-09 14:46 ` [PATCH net-next 11/18] openvswitch: Use nested-BH locking for ovs_actions Sebastian Andrzej Siewior
2025-03-10 14:17 ` [ovs-dev] " Ilya Maximets
2025-03-10 14:44 ` Sebastian Andrzej Siewior
2025-03-10 16:56 ` Ilya Maximets
2025-03-13 11:50 ` Sebastian Andrzej Siewior
2025-03-13 13:23 ` Ilya Maximets
2025-03-13 14:02 ` Sebastian Andrzej Siewior
2025-03-13 14:11 ` Aaron Conole
2025-03-09 14:46 ` [PATCH net-next 12/18] openvswitch: Move ovs_frag_data_storage into the struct ovs_action Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 13/18] net/sched: act_mirred: Move the recursion counter struct netdev_xmit Sebastian Andrzej Siewior
2025-03-21 17:14 ` Davide Caratti
2025-04-11 13:12 ` Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 14/18] net/sched: Use nested-BH locking for sch_frag_data_storage Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 15/18] mptcp: Use nested-BH locking for hmac_storage Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 16/18] rds: Disable only bottom halves in rds_page_remainder_alloc() Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 17/18] rds: Acquire per-CPU pointer within BH disabled section Sebastian Andrzej Siewior
2025-03-09 14:46 ` [PATCH net-next 18/18] rds: Use nested-BH locking for rds_page_remainder Sebastian Andrzej Siewior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99214ac9-cff7-4a5c-b439-ed9ec2c6877c@redhat.com \
--to=pabeni@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=bsegall@google.com \
--cc=davem@davemloft.net \
--cc=dietmar.eggemann@arm.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).