## Re: [Cbe-oss-dev] [RFC, PATCH] CELL Oprofile SPU profiling =?iso-8859-15?q?updated=09patch?=

 Re: [Cbe-oss-dev] [RFC, PATCH] CELL Oprofile SPU profiling =?iso-8859-15?q?updated=09patch?= From: Arnd Bergmann - 2007-02-15 21:04:12 ```On Thursday 15 February 2007 21:21, Carl Love wrote: > I have done some quick measurements. =A0The above method limits the loop > to at most 2^16 iterations. =A0Based on running the algorithm in user > space, it takes about 3ms of computation time to do the loop 2^16 times. >=20 > At the vary least, we need to put the resched in say every 10,000 > iterations which would be about every 0.5ms. =A0Should we do a resched > more often? =A0 Yes, just to be on the safe side, I'd suggest to do it every 1000 iterations. =20 > Additionally we could up the size of the table to 512 which would reduce > the maximum time to about 1.5ms. =A0What do people think about increasing > the table size? No, that won't help too much. I'd say 256 or 128 entries is the most we should have. > As for using a logarithmic spacing of the precomputed values, this > approach means that the space between the precomputed values at the high > end would be much larger then 2^14, assuming 256 precomputed values. > That means it could take much longer then 3ms to get the needed LFSR > value for a large N. =A0By evenly spacing the precomputed values, we can > ensure that for all N it will take less then 3ms to get the value. > Personally, I am more comfortable with a hard limit on the compute time > then a variable time that could get much bigger then the 1ms threshold > that Arnd wants for resched. =A0Any thoughts? When using precomputed values on a logarithmic scale, I'd recommend just rounding to the closest value and accepting the relative inaccuracy, instead of using the precomputed value as the base and then calculating from there. Arnd <>< ```