diff mbox series

[net-next] net: don't set sw irq coalescing defaults in case of PREEMPT_RT

Message ID f9439c7f-c92c-4c2c-703e-110f96d841b7@gmail.com (mailing list archive)
State Accepted
Commit 748b442800e877a93a4fa1256418d0b66bdc55ce
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: don't set sw irq coalescing defaults in case of PREEMPT_RT | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Heiner Kallweit May 28, 2023, 5:39 p.m. UTC
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.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 net/core/dev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Jakub Kicinski May 31, 2023, 6:30 a.m. UTC | #1
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.
Heiner Kallweit May 31, 2023, 8:18 a.m. UTC | #2
On 31.05.2023 08:30, Jakub Kicinski wrote:
> 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.
Jakub Kicinski May 31, 2023, 6:09 p.m. UTC | #3
On Wed, 31 May 2023 10:18:40 +0200 Heiner Kallweit wrote:
> > 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.
patchwork-bot+netdevbpf@kernel.org June 1, 2023, 5:40 a.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index b3c13e041..58f71d619 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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);