Skip to content

Commit

Permalink
[IPVS]: Use msleep_interruptable() instead of ssleep() aka msleep()
Browse files Browse the repository at this point in the history
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.

Signed-Off-By: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Simon Horman authored and David S. Miller committed Dec 11, 2006
1 parent f654c85 commit 89eaeb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ipv4/ipvs/ip_vs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static void sync_master_loop(void)
if (stop_master_sync)
break;

ssleep(1);
msleep_interruptible(1000);
}

/* clean up the sync_buff queue */
Expand Down Expand Up @@ -714,7 +714,7 @@ static void sync_backup_loop(void)
if (stop_backup_sync)
break;

ssleep(1);
msleep_interruptible(1000);
}

/* release the sending multicast socket */
Expand Down Expand Up @@ -826,7 +826,7 @@ static int fork_sync_thread(void *startup)
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;
}

Expand Down Expand Up @@ -860,7 +860,7 @@ int start_sync_thread(int state, char *mcast_ifn, __u8 syncid)
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;
}

Expand Down

0 comments on commit 89eaeb0

Please sign in to comment.