netdev
[Top] [All Lists]

Re: [janitor] sis900: don't use yield()

To: "Randy.Dunlap" <rddunlap@xxxxxxxx>
Subject: Re: [janitor] sis900: don't use yield()
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Tue, 27 Apr 2004 14:03:37 -0400
Cc: netdev <netdev@xxxxxxxxxxx>, ollie@xxxxxxxxxx
In-reply-to: <20040427103807.311caa42.rddunlap@xxxxxxxx>
References: <20040427103807.311caa42.rddunlap@xxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703
Randy.Dunlap wrote:
From: maximilian attems <janitor@xxxxxxxxxxxxxx>

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

Index: linux-266-rc2-kj1/drivers/net/sis900.c
===================================================================
--- linux-266-rc2-kj1.orig/drivers/net/sis900.c 2004-04-03 19:36:57.000000000 
-0800
+++ linux-266-rc2-kj1/drivers/net/sis900.c      2004-04-21 15:32:56.000000000 
-0700
@@ -600,7 +600,8 @@ static int __init sis900_mii_probe (stru
if(status & MII_STAT_LINK){
                while (poll_bit) {
-                       yield();
+                       set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_timeout(HZ/100);


I would rather do schedule_timeout(1), as that's IMO closer to the intention...

        Jeff




<Prev in Thread] Current Thread [Next in Thread>