Skip to contentSkip to conversation

use schedule() instead of yield()

PATCH In review maximilian attems 2 participants 3 messages Apr 19, 2004 – Apr 20, 2004

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

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

patch is on top of 2.6.6-rc1.

yield() removes process from active array into expired array, better just preempt with schedule().
as belows timeout is set to 5 seconds,
schedule() may be better than to use a schedule_timeout(1).

tested on my laptop, but maybe my card never reach this path.

a++ maks

drivers/net/sis900.c +1 -1
diff -ruN a/drivers/net/sis900.c b/drivers/net/sis900.c
@@ -600,7 +600,7 @@
 
 	if(status & MII_STAT_LINK){
 		while (poll_bit) {
-			yield();
+			schedule();
 
 			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

#1 lore raw

Re: [Kernel-janitors] [patch] use schedule() instead of

Max,

Quoted 2 lines · maximilian attems

yield() removes process from active array into expired array, better just preempt with schedule().

What we wanted to do here is just yield the CPU for a bit (not to give
it up for a long time, like the 2.6 yield).

Quoted 1 line

as belows timeout is set to 5 seconds,

	Eh?
Quoted 1 line

schedule() may be better than to use a schedule_timeout(1).

Perhaps:

set_current_state (TASK_UNINTERRUPTIBLE);
schedule_timeout (HZ/100);

	?

Felipe

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

#2 lore raw

Re: [Kernel-janitors] [patch] use schedule() instead of

In reply to maximilian attems
Quoted 5 lines · Felipe W Damasio
Quoted 2 lines

yield() removes process from active array into expired array, better just preempt with schedule().

What we wanted to do here is just yield the CPU for a bit (not to give it up for a long time, like the 2.6 yield).

ok i'll rediff and test tomorrow morning.

Quoted 4 lines
Quoted 2 lines

as belows timeout is set to 5 seconds,

	Eh?

well sis900.c sets

	unsigned long timeout = jiffies + 5 * HZ;

there for i thought that this hole issue "while(poll_bit)" wasn't that timing sensitive.
thanks for your propososal.

a++ maks

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