netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 PATCH] ipvs - make sure the timer expires on one cpu
@ 2003-11-11  7:29 Julian Anastasov
  2003-11-11  8:07 ` Julian Anastasov
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Anastasov @ 2003-11-11  7:29 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Wensong Zhang

[-- Attachment #1: Type: TEXT/PLAIN, Size: 258 bytes --]


	Hello,

	The attached patch fixes the timer expiration for IPVS.
The goal is to avoid scheduling of running timer on another CPU
in short time (jiffie), ip_vs_conn_expire must run only on one
CPU at time per conn.

Regards

--
Julian Anastasov <ja@ssi.bg>

[-- Attachment #2: ipvs timer fix --]
[-- Type: TEXT/PLAIN, Size: 994 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1348  -> 1.1349 
#	net/ipv4/ipvs/ip_vs_conn.c	1.11    -> 1.12   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/11	ja@ssi.bg	1.1349
# [IPVS]: make sure the timer expires on one cpu
# --------------------------------------------
#
diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
--- a/net/ipv4/ipvs/ip_vs_conn.c	Tue Nov 11 08:52:16 2003
+++ b/net/ipv4/ipvs/ip_vs_conn.c	Tue Nov 11 08:52:16 2003
@@ -535,8 +535,10 @@
 
 void ip_vs_conn_expire_now(struct ip_vs_conn *cp)
 {
-	cp->timeout = 0;
-	mod_timer(&cp->timer, jiffies);
+	if (del_timer(&cp->timer)) {
+		cp->timeout = 0;
+		mod_timer(&cp->timer, jiffies);
+	}
 	__ip_vs_conn_put(cp);
 }
 

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

* Re: [2.6 PATCH] ipvs - make sure the timer expires on one cpu
  2003-11-11  7:29 [2.6 PATCH] ipvs - make sure the timer expires on one cpu Julian Anastasov
@ 2003-11-11  8:07 ` Julian Anastasov
  2003-11-12  0:03   ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Anastasov @ 2003-11-11  8:07 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Wensong Zhang

[-- Attachment #1: Type: TEXT/PLAIN, Size: 151 bytes --]


	Hello,

	Ah, sorry. It is bad idea to set cp->timeout to 0. Please,
better use the attached patch instead.

Regards

--
Julian Anastasov <ja@ssi.bg>

[-- Attachment #2: fix ipvs timer, v2 --]
[-- Type: TEXT/PLAIN, Size: 965 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1348  -> 1.1349 
#	net/ipv4/ipvs/ip_vs_conn.c	1.11    -> 1.12   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/11	ja@ssi.bg	1.1349
# [IPVS]: make sure the timer expires on one cpu
# --------------------------------------------
#
diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
--- a/net/ipv4/ipvs/ip_vs_conn.c	Tue Nov 11 10:04:18 2003
+++ b/net/ipv4/ipvs/ip_vs_conn.c	Tue Nov 11 10:04:18 2003
@@ -535,8 +535,8 @@
 
 void ip_vs_conn_expire_now(struct ip_vs_conn *cp)
 {
-	cp->timeout = 0;
-	mod_timer(&cp->timer, jiffies);
+	if (del_timer(&cp->timer))
+		mod_timer(&cp->timer, jiffies);
 	__ip_vs_conn_put(cp);
 }
 

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

* Re: [2.6 PATCH] ipvs - make sure the timer expires on one cpu
  2003-11-11  8:07 ` Julian Anastasov
@ 2003-11-12  0:03   ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-11-12  0:03 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: netdev, wensong

On Tue, 11 Nov 2003 10:07:17 +0200 (EET)
Julian Anastasov <ja@ssi.bg> wrote:

> 	Ah, sorry. It is bad idea to set cp->timeout to 0. Please,
> better use the attached patch instead.

Applied, thanks Julian.

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

end of thread, other threads:[~2003-11-12  0:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-11  7:29 [2.6 PATCH] ipvs - make sure the timer expires on one cpu Julian Anastasov
2003-11-11  8:07 ` Julian Anastasov
2003-11-12  0:03   ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).