linux-rt-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: netdev@vger.kernel.org, linux-rt-devel@lists.linux.dev,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Jesper Dangaard Brouer <hawk@kernel.org>
Subject: Re: [PATCH net-next v3 01/18] net: page_pool: Don't recycle into cache on PREEMPT_RT
Date: Mon, 19 May 2025 11:18:54 +0300	[thread overview]
Message-ID: <CAC_iWjLwssHzyn83XO_XJV8kYBbz76NOsSE2cT90aKPzGLu8aw@mail.gmail.com> (raw)
In-Reply-To: <20250430124758.1159480-2-bigeasy@linutronix.de>

Hi Sebastian

On Wed, 30 Apr 2025 at 15:48, Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> With preemptible softirq and no per-CPU locking in local_bh_disable() on
> PREEMPT_RT the consumer can be preempted while a skb is returned.
>
> Avoid the race by disabling the recycle into the cache on PREEMPT_RT.

I am not expert on PREEMPT_RT, but this sounds reasonable.
Did you have time to test this at all? There's a kernel module Jesper
originally authored to track regressions, which unfortunately isn't
upstreamed yet [0].
Any chance you can quickly spin it to get some numbers?

[0] https://lore.kernel.org/netdev/20250309084118.3080950-1-almasrymina@google.com/

Cheers
/Ilias
>
> Cc: Jesper Dangaard Brouer <hawk@kernel.org>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  net/core/page_pool.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 7745ad924ae2d..ba8803c2c0b20 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -805,6 +805,10 @@ static bool page_pool_napi_local(const struct page_pool *pool)
>         const struct napi_struct *napi;
>         u32 cpuid;
>
> +       /* On PREEMPT_RT the softirq can be preempted by the consumer */
> +       if (IS_ENABLED(CONFIG_PREEMPT_RT))
> +               return false;
> +
>         if (unlikely(!in_softirq()))
>                 return false;
>
> --
> 2.49.0
>

  reply	other threads:[~2025-05-19  8:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 12:47 [PATCH net-next v3 00/18] net: Cover more per-CPU storage with local nested BH locking Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 01/18] net: page_pool: Don't recycle into cache on PREEMPT_RT Sebastian Andrzej Siewior
2025-05-19  8:18   ` Ilias Apalodimas [this message]
2025-04-30 12:47 ` [PATCH net-next v3 02/18] net: dst_cache: Use nested-BH locking for dst_cache::cache Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 03/18] ipv4/route: Use this_cpu_inc() for stats on PREEMPT_RT Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 04/18] ipv6: sr: Use nested-BH locking for hmac_storage Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 05/18] xdp: Use nested-BH locking for system_page_pool Sebastian Andrzej Siewior
2025-04-30 14:20   ` Jesper Dangaard Brouer
2025-05-01 10:13   ` Toke Høiland-Jørgensen
2025-05-02 13:32     ` Sebastian Andrzej Siewior
2025-05-02 14:33       ` Toke Høiland-Jørgensen
2025-05-02 15:07         ` Sebastian Andrzej Siewior
2025-05-02 15:59           ` Toke Høiland-Jørgensen
2025-05-05  8:57             ` Sebastian Andrzej Siewior
2025-05-05  9:13               ` Toke Høiland-Jørgensen
2025-04-30 12:47 ` [PATCH net-next v3 06/18] netfilter: nf_dup{4, 6}: Move duplication check to task_struct Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 07/18] netfilter: nft_inner: Use nested-BH locking for nft_pcpu_tun_ctx Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 08/18] netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 09/18] xfrm: Use nested-BH locking for nat_keepalive_sk_ipv[46] Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 10/18] openvswitch: Merge three per-CPU structures into one Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 11/18] openvswitch: Use nested-BH locking for ovs_pcpu_storage Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 12/18] openvswitch: Move ovs_frag_data_storage into the struct ovs_pcpu_storage Sebastian Andrzej Siewior
2025-05-05 12:34   ` [ovs-dev] " Aaron Conole
2025-04-30 12:47 ` [PATCH net-next v3 13/18] net/sched: act_mirred: Move the recursion counter struct netdev_xmit Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 14/18] net/sched: Use nested-BH locking for sch_frag_data_storage Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 15/18] mptcp: Use nested-BH locking for hmac_storage Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 16/18] rds: Disable only bottom halves in rds_page_remainder_alloc() Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 17/18] rds: Acquire per-CPU pointer within BH disabled section Sebastian Andrzej Siewior
2025-04-30 12:47 ` [PATCH net-next v3 18/18] rds: Use nested-BH locking for rds_page_remainder Sebastian Andrzej Siewior
2025-05-05 23:02 ` [PATCH net-next v3 00/18] net: Cover more per-CPU storage with local nested BH locking Jakub Kicinski
2025-05-09 11:58   ` 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=CAC_iWjLwssHzyn83XO_XJV8kYBbz76NOsSE2cT90aKPzGLu8aw@mail.gmail.com \
    --to=ilias.apalodimas@linaro.org \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tglx@linutronix.de \
    /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).