Skip to contentSkip to conversation

net: don't set sw irq coalescing defaults in case of PREEMPT_RT

PATCH Applied Heiner Kallweit 3 participants 5 messages May 28, 2023 – Jun 1, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: don't set sw irq coalescing defaults in case of PREEMPT_RT

If PREEMPT_RT is set, then assume that the user focuses on minimum latency. Therefore don't set sw irq coalescing defaults. This affects the defaults only, users can override these settings via sysfs.

---
 net/core/dev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/core/dev.c +4 -2
index b3c13e041..58f71d619 100644
@@ -10568,8 +10568,10 @@ void netdev_sw_irq_coalesce_default_on(struct net_device *dev)
 {
 	WARN_ON(dev->reg_state == NETREG_REGISTERED);
 
-	dev->gro_flush_timeout = 20000;
-	dev->napi_defer_hard_irqs = 1;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
+		dev->gro_flush_timeout = 20000;
+		dev->napi_defer_hard_irqs = 1;
+	}
 }
 EXPORT_SYMBOL_GPL(netdev_sw_irq_coalesce_default_on);
 
Signature · 1 line
2.40.1
maintainer
#1 lore raw
Quoted 4 lines · On Sun, 28 May 2023 19:39:59 +0200 Heiner Kallweit wrote:

If PREEMPT_RT is set, then assume that the user focuses on minimum latency. Therefore don't set sw irq coalescing defaults. This affects the defaults only, users can override these settings via sysfs.

Did someone complain? I don't have an opinion, but I'm curious what prompted the patch.

#2 lore raw
Quoted 8 lines · Jakub Kicinski
Quoted 4 lines · On Sun, 28 May 2023 19:39:59 +0200 Heiner Kallweit wrote:

If PREEMPT_RT is set, then assume that the user focuses on minimum latency. Therefore don't set sw irq coalescing defaults. This affects the defaults only, users can override these settings via sysfs.

Did someone complain? I don't have an opinion, but I'm curious what prompted the patch.

No direct complain, and not covering exactly this point.
Background: I witnessed some discussions between PREEMPT_RT users (e.g. from linuxcnc project) regarding network latency with RTL8168 NICs. It seems these users aren't really aware of the userspace knobs that the kernel provides for RT optimization. To make their life easier we could optimize few things for latency and use PREEMPT_RT as an indicator.

maintainer
#3 lore raw
Quoted 10 lines · On Wed, 31 May 2023 10:18:40 +0200 Heiner Kallweit wrote:
Quoted 2 lines

Did someone complain? I don't have an opinion, but I'm curious what prompted the patch.

No direct complain, and not covering exactly this point.
Background: I witnessed some discussions between PREEMPT_RT users (e.g. from linuxcnc project) regarding network latency with RTL8168 NICs. It seems these users aren't really aware of the userspace knobs that the kernel provides for RT optimization. To make their life easier we could optimize few things for latency and use PREEMPT_RT as an indicator.

Makes sense.

#4 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Sun, 28 May 2023 19:39:59 +0200 you wrote:

If PREEMPT_RT is set, then assume that the user focuses on minimum latency. Therefore don't set sw irq coalescing defaults. This affects the defaults only, users can override these settings via sysfs.

[...]

Here is the summary with links:
- [net-next] net: don't set sw irq coalescing defaults in case of PREEMPT_RT

    https://git.kernel.org/netdev/net-next/c/748b442800e8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html