mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edgar Toernig <froese@gmx.de>
To: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
Cc: lkml <linux-kernel@vger.kernel.org>,
	john stultz <johnstul@us.ibm.com>,
	Dominik Brodowski <linux@brodo.de>
Subject: Re: delay_tsc(): inefficient delay loop (2.6.16-mm1)
Date: Fri, 24 Mar 2006 18:37:42 +0100	[thread overview]
Message-ID: <20060324183742.1b1986d1.froese@gmx.de> (raw)
In-Reply-To: <20060324170436.GA1568@rhlx01.fht-esslingen.de>

Andreas Mohr wrote:
>
>  	rdtscl(bclock);
> +	/* offset with bclock to have very simple comparison below */
> +	loops += bclock;
>  	do {
>  		rep_nop();
>  		rdtscl(now);
> -	} while ((now-bclock) < loops);
> +	} while (now < loops);
>  }

Hehe, optimizing delay loops *g*  But your optimization is
wrong.  'loops+bclock' and/or 'now' is likely to wrap around
and then the test condition becomes bogus.

Ciao, ET.

      parent reply	other threads:[~2006-03-24 17:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24 17:04 Andreas Mohr
2006-03-24 17:22 ` Ray Lee
2006-03-24 17:41   ` Andreas Mohr
2006-03-24 17:37 ` Edgar Toernig [this message]

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=20060324183742.1b1986d1.froese@gmx.de \
    --to=froese@gmx.de \
    --cc=andi@rhlx01.fht-esslingen.de \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@brodo.de \
    /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

all inboxes | Powered by JetHome®