Skip to content

Commit 32471b2

Browse files
Sebastian Andrzej SiewiorPaolo Abeni
authored andcommitted
net: page_pool: Don't recycle into cache on PREEMPT_RT
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. Cc: Jesper Dangaard Brouer <[email protected]> Cc: Ilias Apalodimas <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 67fa756 commit 32471b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/core/page_pool.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,10 @@ static bool page_pool_napi_local(const struct page_pool *pool)
839839
const struct napi_struct *napi;
840840
u32 cpuid;
841841

842+
/* On PREEMPT_RT the softirq can be preempted by the consumer */
843+
if (IS_ENABLED(CONFIG_PREEMPT_RT))
844+
return false;
845+
842846
if (unlikely(!in_softirq()))
843847
return false;
844848

0 commit comments

Comments
 (0)