Re: delay_tsc(): inefficient delay loop (2.6.16-mm1)
- From: Edgar Toernig <froese@xxxxxx>
- Date: Fri, 24 Mar 2006 18:37:42 +0100
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- delay_tsc(): inefficient delay loop (2.6.16-mm1)
- From: Andreas Mohr
- delay_tsc(): inefficient delay loop (2.6.16-mm1)
- Prev by Date: [RFC][PATCH 2/2] Virtualization of IPC
- Next by Date: Re: delay_tsc(): inefficient delay loop (2.6.16-mm1)
- Previous by thread: Re: delay_tsc(): inefficient delay loop (2.6.16-mm1)
- Next by thread: [RFC] Virtualization steps
- Index(es):