public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipvs: Move defense_work to system_dfl_long_wq
@ 2026-03-17 14:00 Ismael Luceno
  2026-03-19 16:36 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Ismael Luceno @ 2026-03-17 14:00 UTC (permalink / raw)
  To: linux-kernel, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
	Florian Westphal, Phil Sutter, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Ismael Luceno, Marco Crivellari, Federico Pinca, Andreas Taschner,
	Brad Bendily, Brendon Caligari, Clemens Famulla-Conrad, Firo Yang,
	Gabriel Krisman Bertazi, Hans van den Heuvel, Jean Delvare,
	Michal Hocko, Michal Koutný, Petr Mladek, Petr Tesarik,
	Richard Thompson, William Preston, Yu Xu, Simon Horman, netdev,
	lvs-devel, netfilter-devel, coreteam

Under synflood conditions binding defense_work to system_long_wq may
pin it to a saturated CPU.

We've observed improved throughtput on a DPDK/VPP application with
this change. We attribute this to the reduced context switching.

The defense_work handler has no per-CPU data dependencies and no cache
locality requirements that would justify this.

Signed-off-by: Ismael Luceno <iluceno@suse.de>
---
Depends-on: wq/for-7.1 c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works")

 net/netfilter/ipvs/ip_vs_ctl.c | 6 +++---
 net/netfilter/ipvs/ip_vs_est.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 35642de2a0fe..948ae5882a70 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -234,7 +234,7 @@ #define DEFENSE_TIMER_PERIOD	1*HZ
 	update_defense_level(ipvs);
 	if (atomic_read(&ipvs->dropentry))
 		ip_vs_random_dropentry(ipvs);
-	queue_delayed_work(system_long_wq, &ipvs->defense_work,
+	queue_delayed_work(system_dfl_long_wq, &ipvs->defense_work,
 			   DEFENSE_TIMER_PERIOD);
 }
 #endif
@@ -273,7 +273,7 @@ #define DEFENSE_TIMER_PERIOD	1*HZ
 	atomic_set(&ipvs->est_genid_done, genid);
 
 	if (repeat)
-		queue_delayed_work(system_long_wq, &ipvs->est_reload_work,
+		queue_delayed_work(system_dfl_long_wq, &ipvs->est_reload_work,
 				   delay);
 
 unlock:
@@ -4377,7 +4377,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 		goto err;
 
 	/* Schedule defense work */
-	queue_delayed_work(system_long_wq, &ipvs->defense_work,
+	queue_delayed_work(system_dfl_long_wq, &ipvs->defense_work,
 			   DEFENSE_TIMER_PERIOD);
 
 	return 0;
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index b17de33314da..454ea24828cc 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -235,7 +235,7 @@ #define pr_fmt(fmt) "IPVS: " fmt
 	ip_vs_est_stopped_recalc(ipvs);
 	/* Bump the kthread configuration genid */
 	atomic_inc(&ipvs->est_genid);
-	queue_delayed_work(system_long_wq, &ipvs->est_reload_work, 0);
+	queue_delayed_work(system_dfl_long_wq, &ipvs->est_reload_work, 0);
 }
 
 /* Start kthread task with current configuration */

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

* Re: [PATCH] ipvs: Move defense_work to system_dfl_long_wq
  2026-03-17 14:00 [PATCH] ipvs: Move defense_work to system_dfl_long_wq Ismael Luceno
@ 2026-03-19 16:36 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-03-19 16:36 UTC (permalink / raw)
  To: Ismael Luceno
  Cc: linux-kernel, Julian Anastasov, Pablo Neira Ayuso,
	Florian Westphal, Phil Sutter, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Marco Crivellari, Federico Pinca,
	Andreas Taschner, Brad Bendily, Brendon Caligari,
	Clemens Famulla-Conrad, Firo Yang, Gabriel Krisman Bertazi,
	Hans van den Heuvel, Jean Delvare, Michal Hocko,
	Michal Koutný, Petr Mladek, Petr Tesarik, Richard Thompson,
	William Preston, Yu Xu, netdev, lvs-devel, netfilter-devel,
	coreteam

On Tue, Mar 17, 2026 at 03:00:59PM +0100, Ismael Luceno wrote:
> Under synflood conditions binding defense_work to system_long_wq may
> pin it to a saturated CPU.
> 
> We've observed improved throughtput on a DPDK/VPP application with
> this change. We attribute this to the reduced context switching.
> 
> The defense_work handler has no per-CPU data dependencies and no cache
> locality requirements that would justify this.
> 
> Signed-off-by: Ismael Luceno <iluceno@suse.de>
> ---
> Depends-on: wq/for-7.1 c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works")

Hi Ismael,

This patch seems suitable to be targeted at the nf-next tree.
That should be annotated like this:

Subject [PATCH nf-next] ipvs: ...

And the patch must compile when applied to it's target tree.
So you'll need to repost this patch once the dependency above
has reached that tree.

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

end of thread, other threads:[~2026-03-19 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 14:00 [PATCH] ipvs: Move defense_work to system_dfl_long_wq Ismael Luceno
2026-03-19 16:36 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox