Commit 32471b2f authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Paolo Abeni
Browse files

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 <hawk@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20250512092736.229935-2-bigeasy@linutronix.de


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 67fa7564
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -839,6 +839,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;