Skip to content

Commit

Permalink
net/core: disable NET_RX_BUSY_POLL on RT
Browse files Browse the repository at this point in the history
napi_busy_loop() disables preemption and performs a NAPI poll. We can't acquire
sleeping locks with disabled preemption so we would have to work around this
and add explicit locking for synchronisation against ksoftirqd.
Without explicit synchronisation a low priority process would "own" the NAPI
state (by setting NAPIF_STATE_SCHED) and could be scheduled out (no
preempt_disable() and BH is preemptible on RT).
In case a network packages arrives then the interrupt handler would set
NAPIF_STATE_MISSED and the system would wait until the task owning the NAPI
would be scheduled in again.
Should a task with RT priority busy poll then it would consume the CPU instead
allowing tasks with lower priority to run.

The NET_RX_BUSY_POLL is disabled by default (the system wide sysctls for
poll/read are set to zero) so disable NET_RX_BUSY_POLL on RT to avoid wrong
locking context on RT. Should this feature be considered useful on RT systems
then it could be enabled again with proper locking and synchronisation.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Sebastian Andrzej Siewior committed Sep 13, 2021
1 parent a07f998 commit cfc2628
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ config CGROUP_NET_CLASSID

config NET_RX_BUSY_POLL
bool
default y
default y if !PREEMPT_RT

config BQL
bool
Expand Down

0 comments on commit cfc2628

Please sign in to comment.