* [Kernel-janitors] [patch] use schedule() instead of yield()
@ 2004-04-19 16:57 maximilian attems
2004-04-19 17:13 ` [Kernel-janitors] [patch] use schedule() instead of Felipe W Damasio
2004-04-20 19:19 ` maximilian attems
0 siblings, 2 replies; 3+ messages in thread
From: maximilian attems @ 2004-04-19 16:57 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
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
diff -ruN a/drivers/net/sis900.c b/drivers/net/sis900.c
--- a/drivers/net/sis900.c 2004-03-16 08:47:07.000000000 +0100
+++ b/drivers/net/sis900.c 2004-03-12 11:19:29.000000000 +0100
@@ -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)) {
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Kernel-janitors] [patch] use schedule() instead of
2004-04-19 16:57 [Kernel-janitors] [patch] use schedule() instead of yield() maximilian attems
@ 2004-04-19 17:13 ` Felipe W Damasio
2004-04-20 19:19 ` maximilian attems
1 sibling, 0 replies; 3+ messages in thread
From: Felipe W Damasio @ 2004-04-19 17:13 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
Max,
maximilian attems wrote:
> 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).
> as belows timeout is set to 5 seconds,
Eh?
> schedule() may be better than to use a schedule_timeout(1).
Perhaps:
set_current_state (TASK_UNINTERRUPTIBLE);
schedule_timeout (HZ/100);
?
Felipe
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Kernel-janitors] [patch] use schedule() instead of
2004-04-19 16:57 [Kernel-janitors] [patch] use schedule() instead of yield() maximilian attems
2004-04-19 17:13 ` [Kernel-janitors] [patch] use schedule() instead of Felipe W Damasio
@ 2004-04-20 19:19 ` maximilian attems
1 sibling, 0 replies; 3+ messages in thread
From: maximilian attems @ 2004-04-20 19:19 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 570 bytes --]
On Mon, 19 Apr 2004, Felipe W Damasio wrote:
> >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.
>
> >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
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-04-20 19:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-19 16:57 [Kernel-janitors] [patch] use schedule() instead of yield() maximilian attems
2004-04-19 17:13 ` [Kernel-janitors] [patch] use schedule() instead of Felipe W Damasio
2004-04-20 19:19 ` maximilian attems
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.