Skip to contentSkip to conversation

net/ip_vs_sync: replace schedule_timeout() with ssleep()

PATCH Applied Nishanth Aravamudan 2 participants 2 messages Jan 20, 2005 – Feb 9, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 20/39 net/ip_vs_sync: replace schedule_timeout() with ssleep()

Hi,

Please consider applying.

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.

net/ipv4/ipvs/ip_vs_sync.c +5 -9
@@ -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 *startu
 	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 *m
 	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;
 	}
 

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

maintainer Applied
#1 lore raw
Quoted 7 lines · On Thu, 20 Jan 2005 15:56:34 -0800 Nishanth Aravamudan <[email protected]> wrote:

Please consider applying.

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.

Applied, thanks Nishanth.

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors