aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-02-08 04:04:08 -0800
committerDavid S. Miller <davem@kernel.bkbits.net>2005-02-08 04:04:08 -0800
commitf8afb60c7537130448cc479d6d8dc9bf4ee06027 (patch)
treebf3b4785b683c3d4339261ec45ca1500d5ae8302
parent3b3ed7823cd33cc1ebdee3f8c47e6e7169e7fb6c (diff)
downloadhistory-f8afb60c7537130448cc479d6d8dc9bf4ee06027.tar.gz
[IPVS]: Replace schedule_timeout() with ssleep()
Description: Use ssleep() instead of schedule_timeout() to guarantee the task delays as expected. The first two replacements use TASK_INTERRUPTIBLE but do not check for signals, so ssleep() should be appropriate. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/ipvs/ip_vs_sync.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index da30bebbddc897..25c479550a32f3 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -23,7 +23,7 @@
#include <linux/slab.h>
#include <linux/net.h>
#include <linux/completion.h>
-
+#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/in.h>
#include <linux/igmp.h> /* for ip_mc_join_group */
@@ -647,8 +647,7 @@ static void sync_master_loop(void)
if (stop_master_sync)
break;
- __set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(HZ);
+ ssleep(1);
}
/* clean up the sync_buff queue */
@@ -705,8 +704,7 @@ static void sync_backup_loop(void)
if (stop_backup_sync)
break;
- __set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(HZ);
+ ssleep(1);
}
/* release the sending multicast socket */
@@ -818,8 +816,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);
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ);
+ ssleep(1);
goto repeat;
}
@@ -853,8 +850,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);
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ);
+ ssleep(1);
goto repeat;
}