Thread (31 messages) 31 messages, 6 authors, 2025-05-19

Re: [PATCH net-next v3 01/18] net: page_pool: Don't recycle into cache on PREEMPT_RT

From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Date: 2025-05-19 08:19:31
Also in: linux-rt-devel

Hi Sebastian

On Wed, 30 Apr 2025 at 15:48, Sebastian Andrzej Siewior
[off-list ref] 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/ (local)

Cheers
/Ilias
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help