On 30 April 2007 20:11, kernel coder wrote: > Following are few lines of code which are consuming close to 100 > cycles.Yes this is not the forum for such questions but i think people > on linux kernel and GCC are best to answer such type of questions.
If it's an issue caused by gcc generating very bad choices of code sequence, then of course this is the right place to put it. > I'm > realy getting frustated and helpless ,that's why i've put question on > this forum. If, on the other hand, it's not such an issue, gcc-help is the correct place to post it, because whether a post is on topic does NOT depend on your personal emotions and/or impatience. > The overhead varies from generally 360 to 395 cycles .Sometimes it > also reduces close to 270 cycles. > > Cycles consumed by the targetd code varies from 20 to 100 > cycles.Theoratically i thing cycles consumed should be less than > 20.Then why so many cycles ? and the output vary from 20 to 100 > cycles .Sometimes it crosses 100 cycles as well. > > Sometimes the cycles consumed by targetted code become far less that > the RDTSC instrucion overhead. > > Is there better way to write above code.I even used the prefetch > instruction before the targeted code to make sure that buffer is in > the L1 cache but no success. > > The code for ReadTsc() is as follows.Please also tell me if its > correct way to measure cycles . Nope, this is a gcc-help question. Off you go. Ask them to tell you how to disable interrupts when you get there. cheers, DaveK -- Can't think of a witty .sigline today....