All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT
@ 2021-10-01 14:58 Sebastian Andrzej Siewior
  2021-10-01 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2021-10-01 14:58 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Jakub Kicinski, Thomas Gleixner,
	Sebastian Andrzej Siewior

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 <bigeasy@linutronix.de>
---
 net/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/Kconfig b/net/Kconfig
index fb13460c6dab3..074472dfa94ae 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -294,7 +294,7 @@ config CGROUP_NET_CLASSID
 
 config NET_RX_BUSY_POLL
 	bool
-	default y
+	default y if !PREEMPT_RT
 
 config BQL
 	bool
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT
  2021-10-01 14:58 [PATCH net-next] net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT Sebastian Andrzej Siewior
@ 2021-10-01 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-01 22:50 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: netdev, davem, kuba, tglx

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri,  1 Oct 2021 16:58:41 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT
    https://git.kernel.org/netdev/net-next/c/20ab39d13e2e

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-01 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 14:58 [PATCH net-next] net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT Sebastian Andrzej Siewior
2021-10-01 22:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.