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 |
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.
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.
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.
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 --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);
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(-)