Commit f8afb60c authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by David S. Miller

[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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b3ed782
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/delay.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/igmp.h> /* for ip_mc_join_group */ #include <linux/igmp.h> /* for ip_mc_join_group */
...@@ -647,8 +647,7 @@ static void sync_master_loop(void) ...@@ -647,8 +647,7 @@ static void sync_master_loop(void)
if (stop_master_sync) if (stop_master_sync)
break; break;
__set_current_state(TASK_INTERRUPTIBLE); ssleep(1);
schedule_timeout(HZ);
} }
/* clean up the sync_buff queue */ /* clean up the sync_buff queue */
...@@ -705,8 +704,7 @@ static void sync_backup_loop(void) ...@@ -705,8 +704,7 @@ static void sync_backup_loop(void)
if (stop_backup_sync) if (stop_backup_sync)
break; break;
__set_current_state(TASK_INTERRUPTIBLE); ssleep(1);
schedule_timeout(HZ);
} }
/* release the sending multicast socket */ /* release the sending multicast socket */
...@@ -818,8 +816,7 @@ static int fork_sync_thread(void *startup) ...@@ -818,8 +816,7 @@ static int fork_sync_thread(void *startup)
if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) { if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
IP_VS_ERR("could not create sync_thread due to %d... " IP_VS_ERR("could not create sync_thread due to %d... "
"retrying.\n", pid); "retrying.\n", pid);
current->state = TASK_UNINTERRUPTIBLE; ssleep(1);
schedule_timeout(HZ);
goto repeat; goto repeat;
} }
...@@ -853,8 +850,7 @@ int start_sync_thread(int state, char *mcast_ifn, __u8 syncid) ...@@ -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) { if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
IP_VS_ERR("could not create fork_sync_thread due to %d... " IP_VS_ERR("could not create fork_sync_thread due to %d... "
"retrying.\n", pid); "retrying.\n", pid);
current->state = TASK_UNINTERRUPTIBLE; ssleep(1);
schedule_timeout(HZ);
goto repeat; goto repeat;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment