Skip to contentSkip to conversation

net/dev: replace schedule_timeout() with msleep()

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

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

PATCH 19/39 net/dev: replace schedule_timeout() with msleep()

Hi,

Please consider applying.

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not respond to signals, so msleep() should be ok.

net/core/dev.c +2 -2
@@ -108,6 +108,7 @@
 #include <linux/kallsyms.h>
 #include <linux/netpoll.h>
 #include <linux/rcupdate.h>
+#include <linux/delay.h>
 #ifdef CONFIG_NET_RADIO
 #include <linux/wireless.h>		/* Note : will define WIRELESS_EXT */
 #include <net/iw_handler.h>
@@ -2899,8 +2900,7 @@ static void netdev_wait_allrefs(struct n
 			rebroadcast_time = jiffies;
 		}
 
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(HZ / 4);
+		msleep(250);
 
 		if (time_after(jiffies, warning_time + 10 * HZ)) {
 			printk(KERN_EMERG "unregister_netdevice: "

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

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

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not respond to signals, so msleep() should be ok.

Applied, thanks Nishanth.

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