Stupid question regarding bogomips and udelay()
From: François <hidden>
Date: 2016-08-01 09:47:53
Hello, that's an interesting question! I'm currently reading the same book, but you've read more than me so far :) On Mon, Aug 01, 2016 at 08:36:07AM +0300, Aleksander Alekseev wrote:
* bogomips value (see `cat /proc/cpuinfo`) is determined only once during system boot
As far as I know, I is (was?) the case.
It's my understanding that it shouldn't work. CPU frequency actually changes manually (see cpufrequtils) and/or automatically depending for instance on laptop's current battery charge. There is also such a nasty thing as Intel Turbo Boost. In other words actual MIPS could be higher or lower than measured MIPS. So udealy() can't guarantee anything.
Makes sense. Do you have such machine? Did you try to get bogomips and then reduce your CPU count / speed and get that number again? Maybe this value is now dynamic. Also, did you actually try udealay() in high/low frequency to see wether you see an actual difference between runs? Sorry I don't have final answers! -- Fran?ois