Should we relax in udelay()?
Would the following patch be a good idea? Obviously, this is a busy-loop, but does itc tick correctly while we're relaxing?
Index: include/asm-ia64/delay.h
=================================RCS file: /var/cvs/linux-2.6/include/asm-ia64/delay.h,v retrieving revision 1.4
include/asm-ia64/delay.h +1 -1
@@ -91,7 +91,7 @@ udelay (unsigned long usecs)unsigned long cycles = usecs*local_cpu_data->cyc_per_usec;while (ia64_get_itc () - start < cycles) - /* skip */; + cpu_relax(); }#endif /* _ASM_IA64_DELAY_H */
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Matthew Wilcox
Matthew> Would the following patch be a good idea?
I think so.
Matthew> Obviously, this is a busy-loop, but does itc tick correctly Matthew> while we're relaxing?
Yes.
--david