lkml.org 
[lkml]   [2006]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: delay_tsc(): inefficient delay loop (2.6.16-mm1)
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-24 18:40    [W:0.043 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site