I have managed to stay away from video games for the past few months but decided to pick up one of my old favorites and spend a little time playing. Much to my dismay, 3D performance had regressed since the last time I played a full-on video game. Most FOSS and commercial games were running at 10 FPS or so. 32 and 64 bit. 100% CPU utilization.
Well, after running some oprofile and sysprof stuff, I discovered that some 60% of the CPU was being spent on in-Xorg and in-Kernel video computation. So, I thought surely it was related to some new DRI2 stuff I was running. So... I went backwards two years in Intel graphics driver development. No change; little faster. I went forward to the very latest and greatest stuff (and X, kernel and userspace Mesa): Gallium3D with DRI2 state tracker on KMS. 30% speed up but still ~15 FPS on average. So it wasn't the driver...
Finally, I decided to pull out the big guns and SSH in to my laptop while playing to watch various things. During this, I discovered that CPUFreq ondemand never raised my frequency above 800MHz. "What?" I thought, "Surely ondemand is still reliable... isn't it?" We've been recommending to people that they always use ondemand since at least the 2.6.9 days. So, after:
sudo cpufreq-set -c 0 -g performance sudo cpufreq-set -c 1 -g performance
And running every game I have, beautifully, at generally around 60 FPS (vsync), I was armed with new information to Google. And indeed, there are reports starting around mid-last year that ondemand was having major regressions. And they appear to have been largely ignored, so far.
So, does anyone know what the hell is going on with ondemand?
Here's some anecdotal evidence which may help: computational benchmarks which do 100% of their calculation in user-space correctly scale the CPU; anything which performs a portion of its work inside the kernel (graphics related stuff) does not scale the CPU
For now, my laptop has roughly 50% battery life. *sigh*
Update 2009-04-12: I had been building my own kernel throughout the mentioned series and then switched to the official Debian 2.6.29 series--the problem was still there. A week ago, I switched to Fedora--to get closer to Gnome development in more aspects--and discovered that Fedora's build of 2.6.29 is not affected. I haven't had a chance to look it what the underlying differences might be but perhaps some enterprising person will beat me to it.