From f113f488e31f4230cf9dd5bfba0c0383005024a9 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <>
Date: Fri, 1 Oct 2021 16:58:41 +0200
Subject: [PATCH 024/166] net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT

napi_busy_loop() disables preemption and performs a NAPI poll. We can't acquire
sleeping locks with disabled preemption which would be required while
__napi_poll() invokes the callback of the driver.

A threaded interrupt performing the NAPI-poll can be preempted on PREEMPT_RT.
A RT thread on another CPU may observe NAPIF_STATE_SCHED bit set and busy-spin
until it is cleared or its spin time runs out. Given it is the task with the
highest priority it will never observe the NEED_RESCHED bit set.
In this case the time is better spent by simply sleeping.

The NET_RX_BUSY_POLL is disabled by default (the system wide sysctls for
poll/read are set to zero). Disabling NET_RX_BUSY_POLL on PREEMPT_RT to avoid
wrong locking context in case it is used.

Signed-off-by: Sebastian Andrzej Siewior <>
Signed-off-by: Jakub Kicinski <>
 net/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-5.15.32-rt39/net/Kconfig
@ linux-5.15.32-rt39/net/Kconfig:297 @ config CGROUP_NET_CLASSID
-	default y
+	default y if !PREEMPT_RT
 config BQL