Skip to contentSkip to conversation

use schedule_timeout() instead of yield()

PATCH New maximilian attems 1 participant 1 message Apr 21, 2004

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

PATCH 1/1 use schedule_timeout() instead of yield()

thanks to Felipe W Damasio hint rediffed.
patch is on top of linux-2.6.6-rc2

yield() removes process from active array into expired array, better just yield the CPU for a bit.
tested on my laptop with a sis900.

a++ maks

drivers/net/sis900.c +2 -1
diff -ruN a/drivers/net/sis900.c b/drivers/net/sis900.c
@@ -600,7 +600,8 @@
 
 	if(status & MII_STAT_LINK){
 		while (poll_bit) {
-			yield();
+			set_current_state (TASK_UNINTERRUPTIBLE);
+			schedule_timeout(HZ/100);
 
 			poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit);
 			if (time_after_eq(jiffies, timeout)) {

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