All of lore.kernel.org
 help / color / mirror / Atom feed
* [janitor] sis900: don't use yield()
@ 2004-04-27 17:38 Randy.Dunlap
  2004-04-27 18:03 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Randy.Dunlap @ 2004-04-27 17:38 UTC (permalink / raw)
  To: netdev; +Cc: jgarzik, ollie


From: maximilian attems <janitor@sternwelten.at>

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);
 
 			poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit);
 			if (time_after_eq(jiffies, timeout)) {


--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [janitor] sis900: don't use yield()
  2004-04-27 17:38 [janitor] sis900: don't use yield() Randy.Dunlap
@ 2004-04-27 18:03 ` Jeff Garzik
  2004-04-27 18:28   ` [janitor] sis900: don't use yield() (v2) Randy.Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2004-04-27 18:03 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: netdev, ollie

Randy.Dunlap wrote:
> From: maximilian attems <janitor@sternwelten.at>
> 
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [janitor] sis900: don't use yield() (v2)
  2004-04-27 18:03 ` Jeff Garzik
@ 2004-04-27 18:28   ` Randy.Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy.Dunlap @ 2004-04-27 18:28 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, ollie

On Tue, 27 Apr 2004 14:03:37 -0400 Jeff Garzik wrote:

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


From: maximilian attems <janitor@sternwelten.at>
Subject: [Kernel-janitors] [patch] use schedule_timeout() instead of yield()
	drivers/net/sis900.c


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.


 drivers/net/sis900.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


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(1);
 
 			poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit);
 			if (time_after_eq(jiffies, timeout)) {


--

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-27 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-27 17:38 [janitor] sis900: don't use yield() Randy.Dunlap
2004-04-27 18:03 ` Jeff Garzik
2004-04-27 18:28   ` [janitor] sis900: don't use yield() (v2) Randy.Dunlap

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.