netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [IPVS] use msleep_interruptable() instead of ssleep() aka msleep()
@ 2006-11-28  6:27 Horms
  2006-11-28  8:35 ` Julian Anastasov
  0 siblings, 1 reply; 4+ messages in thread
From: Horms @ 2006-11-28  6:27 UTC (permalink / raw)
  To: netdev
  Cc: David Miller, Dean Manners, Wensong Zhan, Julian Anastasov,
	Joseph Mack NA3T

Dean Manners notices that when an IPVS synchonisation daemons are
started the system load slowly climbs up to 1. This seems to be related
to the call to ssleep(1) (aka msleep(1000) in the main loop. Replacing
this with a call to msleep_interruptable() seems to make the problem go
away. Though I'm not sure that it is correct.

Cc: Dean Manners <deanm@ispone.com.au>
Signed-Off-By: Simon Horman <horms@verge.net.au>

Index: linux-2.6/net/ipv4/ipvs/ip_vs_sync.c
===================================================================
--- linux-2.6.orig/net/ipv4/ipvs/ip_vs_sync.c	2006-11-10 15:33:42.000000000 +0900
+++ linux-2.6/net/ipv4/ipvs/ip_vs_sync.c	2006-11-10 15:33:52.000000000 +0900
@@ -657,7 +657,7 @@
 		if (stop_master_sync)
 			break;
 
-		ssleep(1);
+		msleep_interruptible(1000);
 	}
 
 	/* clean up the sync_buff queue */

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

* Re: [PATCH] [IPVS] use msleep_interruptable() instead of ssleep() aka msleep()
  2006-11-28  6:27 [PATCH] [IPVS] use msleep_interruptable() instead of ssleep() aka msleep() Horms
@ 2006-11-28  8:35 ` Julian Anastasov
  2006-11-29  0:58   ` Horms
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Anastasov @ 2006-11-28  8:35 UTC (permalink / raw)
  To: Horms; +Cc: netdev, David Miller, Dean Manners, Wensong Zhan,
	Joseph Mack NA3T


	Hello,

On Tue, 28 Nov 2006, Horms wrote:

> Dean Manners notices that when an IPVS synchonisation daemons are
> started the system load slowly climbs up to 1. This seems to be related
> to the call to ssleep(1) (aka msleep(1000) in the main loop. Replacing
> this with a call to msleep_interruptable() seems to make the problem go
> away. Though I'm not sure that it is correct.

	The same is needed for sync_backup_loop

> -		ssleep(1);
> +		msleep_interruptible(1000);

Regards

--
Julian Anastasov <ja@ssi.bg>

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

* Re: [PATCH] [IPVS] use msleep_interruptable() instead of ssleep() aka msleep()
  2006-11-28  8:35 ` Julian Anastasov
@ 2006-11-29  0:58   ` Horms
  2006-12-11  6:35     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Horms @ 2006-11-29  0:58 UTC (permalink / raw)
  To: Julian Anastasov
  Cc: netdev, David Miller, Dean Manners, Wensong Zhan,
	Joseph Mack NA3T

On Tue, Nov 28, 2006 at 10:35:01AM +0200, Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Tue, 28 Nov 2006, Horms wrote:
> 
> > Dean Manners notices that when an IPVS synchonisation daemons are
> > started the system load slowly climbs up to 1. This seems to be related
> > to the call to ssleep(1) (aka msleep(1000) in the main loop. Replacing
> > this with a call to msleep_interruptable() seems to make the problem go
> > away. Though I'm not sure that it is correct.
> 
> 	The same is needed for sync_backup_loop

Good point. It also seems as well to change it in fork_sync_thread()
and start_sync_thread(), though these are unlikely to be causing a problem.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

Dean Manners notices that when an IPVS synchonisation daemons are
started the system load slowly climbs up to 1. This seems to be related
to the call to ssleep(1) (aka msleep(1000) in the main loop. Replacing
this with a call to msleep_interruptable() seems to make the problem go
away. Though I'm not sure that it is correct.

This is the second edition of this patch, which replaces ssleep()
in the main loop for both the master and backup threads, as well
as some thread synchronisation code. The latter is just for thorougness
as it shouldn't be causing any problems.

Cc: Dean Manners <deanm@ispone.com.au>
Cc: Julian Anastasov <ja@ssi.bg>
Signed-Off-By: Simon Horman <horms@verge.net.au>

Index: linux-2.6/net/ipv4/ipvs/ip_vs_sync.c
===================================================================
--- linux-2.6.orig/net/ipv4/ipvs/ip_vs_sync.c	2006-11-28 15:30:00.000000000 +0900
+++ linux-2.6/net/ipv4/ipvs/ip_vs_sync.c	2006-11-29 09:46:27.000000000 +0900
@@ -657,7 +657,7 @@
 		if (stop_master_sync)
 			break;
 
-		ssleep(1);
+		msleep_interruptible(1000);
 	}
 
 	/* clean up the sync_buff queue */
@@ -714,7 +714,7 @@
 		if (stop_backup_sync)
 			break;
 
-		ssleep(1);
+		msleep_interruptible(1000);
 	}
 
 	/* release the sending multicast socket */
@@ -826,7 +826,7 @@
 	if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
 		IP_VS_ERR("could not create sync_thread due to %d... "
 			  "retrying.\n", pid);
-		ssleep(1);
+		msleep_interruptible(1000);
 		goto repeat;
 	}
 
@@ -860,7 +860,7 @@
 	if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
 		IP_VS_ERR("could not create fork_sync_thread due to %d... "
 			  "retrying.\n", pid);
-		ssleep(1);
+		msleep_interruptible(1000);
 		goto repeat;
 	}
 

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

* Re: [PATCH] [IPVS] use msleep_interruptable() instead of ssleep() aka msleep()
  2006-11-29  0:58   ` Horms
@ 2006-12-11  6:35     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2006-12-11  6:35 UTC (permalink / raw)
  To: horms; +Cc: ja, netdev, deanm, wensong, jmack

From: Horms <horms@verge.net.au>
Date: Wed, 29 Nov 2006 09:58:35 +0900

> On Tue, Nov 28, 2006 at 10:35:01AM +0200, Julian Anastasov wrote:
> > 
> > 	Hello,
> > 
> > On Tue, 28 Nov 2006, Horms wrote:
> > 
> > > Dean Manners notices that when an IPVS synchonisation daemons are
> > > started the system load slowly climbs up to 1. This seems to be related
> > > to the call to ssleep(1) (aka msleep(1000) in the main loop. Replacing
> > > this with a call to msleep_interruptable() seems to make the problem go
> > > away. Though I'm not sure that it is correct.
> > 
> > 	The same is needed for sync_backup_loop
> 
> Good point. It also seems as well to change it in fork_sync_thread()
> and start_sync_thread(), though these are unlikely to be causing a problem.

Applied, thanks Simon.


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

end of thread, other threads:[~2006-12-11  6:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28  6:27 [PATCH] [IPVS] use msleep_interruptable() instead of ssleep() aka msleep() Horms
2006-11-28  8:35 ` Julian Anastasov
2006-11-29  0:58   ` Horms
2006-12-11  6:35     ` David 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).