netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: netdev <netdev@oss.sgi.com>, ollie@sis.com.tw
Subject: Re: [janitor] sis900: don't use yield()
Date: Tue, 27 Apr 2004 14:03:37 -0400	[thread overview]
Message-ID: <408EA079.3060604@pobox.com> (raw)
In-Reply-To: <20040427103807.311caa42.rddunlap@osdl.org>

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

  reply	other threads:[~2004-04-27 18:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-27 17:38 [janitor] sis900: don't use yield() Randy.Dunlap
2004-04-27 18:03 ` Jeff Garzik [this message]
2004-04-27 18:28   ` [janitor] sis900: don't use yield() (v2) Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=408EA079.3060604@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=ollie@sis.com.tw \
    --cc=rddunlap@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).