Kai Schaetzl
2008-Aug-03 12:31 UTC
[CentOS] Questions on cpu frequency scaling AMD vs. Intel
I've been playing and comparing frequency scaling between AMD and Intel CPUs yesterday and there seem to be great differences between AMD and Intel and some gotchas. This is all on CentOS 5.2 with latest Xen kernels (which are supposed to be powersaving-enabled since 5.2). AMD: It seems once I get the AMD CPU to use the ondemand governor it works very well and very efficiently. But this is not set by default, one has to set ondemand explicitely in /etc/sysconfig/cpuspeed and run cpuspeed on bootup. Otherwise it just knows about userspace and performance and defaults to performance. Intel: On the other side ondemand is on for Intel CPUs automatically, but it doesn't seem to work. No matter if I run cpuspeed or not the current frequency is shown as 2000000. This is the scaling_min_freq for both CPUs I checked. The scaling_max_freq is 2.333/2.5. One is a Xeon Dual Core, one a Xeon Quad Core. With "not seem to work" for Intel I mean it doesn't act on demand as it should. I tested by gzipping and gunzipping a 4 GB image file. I used top to observe CPU utilization. With a dual core the idle percentage stays around 50% for a while and only goes below this threshold near the end of the operation. I deduce that means that gzip can make use of only one core and only when it comes to writing to disk or using other external tools it can utilize more CPU power because that task is taken over to the other core. Same observation with quad core (and 75%). There is no difference between AMD and Intel in this respect, but the task seems to run a bit more efficiently on an AMD CPU - e.g. it is able to max out idle at 0% at least for short periods while this is almost impossible to observe with the Intel CPUs. The timing also shows that the AMD is the fastest one. (The AMD, a very new low voltage X2, also runs at 2500 max.) My question: why don't the Intel CPUs don't scale up on demand? Could there be a bug in the driver that it measures overall utilization (which is at 50% most of the time) and not single core utilization, thus never reaching the threshold for scaling up? up_threshold is at 80 for both CPUs. (cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold) I have a somewhat related question. That very new AMD CPU mentioned above was not recognized by CentOS 5.2 and the current frequency was shown as 800000 (instead of 2500000), although it was running in full speed. The latest kernel corrected this. It's still unknown, but the frequency is now calculated correctly and thus frequency scaling works now (it didn't work when it was miscalculating at 800000). On the other hand, I have an older low-voltage AMD CPU (probably about 2 years on the market) that is recognized as X2 3800+ but frequency scaling fails because it miscalculates the current speed to 800 MHz as well. Is there anything I can do about that? Where could I check whether this CPU should be supported in full and frequency scaling working? (I'm not sure, but I think it may have actually worked when it was running in a different motherboard.) Kai -- Kai Sch?tzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
Ned Slider
2008-Aug-03 14:09 UTC
[CentOS] Questions on cpu frequency scaling AMD vs. Intel
Kai Schaetzl wrote:> I've been playing and comparing frequency scaling between AMD and Intel > CPUs yesterday and there seem to be great differences between AMD and > Intel and some gotchas. This is all on CentOS 5.2 with latest Xen kernels > (which are supposed to be powersaving-enabled since 5.2). >I was looking at cpu frequency scaling a week or two ago on an Intel Q6600 quad core cpu. Rather than repeat myself, there are some numbers in this thread (post #6 amongst others): http://www.centos.org/modules/newbb/viewtopic.php?topic_id=15484&forum=37 Bottom line - the power saving between having frequency scaling enabled or not was surprisingly small (only 2-3W). It would appear that these processors are already fairly efficient at idle and scaling down the frequency adds little to the overall savings that may be obtained.
Kai Schaetzl
2008-Aug-03 14:31 UTC
[CentOS] Questions on cpu frequency scaling AMD vs. Intel
Kai Schaetzl wrote on Sun, 03 Aug 2008 14:31:19 +0200:> I have a somewhat related question. That very new AMD CPU mentioned above > was not recognized by CentOS 5.2 and the current frequency was shown as > 800000 (instead of 2500000), although it was running in full speed. The > latest kernel corrected this.Actually, not the latest kernel. The CentOS xen boot (hypervisor) kernel /xen.gz-2.6.18-92.1.6.el5 (and maybe earlier) ones calculates the frequency correct, the Xen 3.2 boot kernel (xen.gz-3.2) from the Xen 3.2 package offered at xen.org does not. Might there be a kernel parameter or other measure that could correct this? (I don't want to recompile any kernels.) I wondered if it also the source of the inability to scale up on demand with the Intel CPUs and the 2000000 reported is actually wrong. But there is no change between the two boot kernels. Kai -- Kai Sch?tzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
On Sunday, August 03, 2008 at 8:31 AM, Kai Schaetzl wrote:> > ...I have an older low-voltage AMD CPU (probably about 2 years > on the market) that is recognized as X2 3800+ but frequency > scaling fails because it miscalculates the current speed to > 800 MHz as well. Is there anything I can do about that? Where > could I check whether this CPU should be supported in full and > frequency scaling working? >The cpuspeed changelog may be relevant: [quote] * Thu Mar 06 2008 Jarod Wilson <jwilson at redhat.com> - Disable freq scaling by default on AMD rev F and earlier cpus when running xen, due to clock instability (#435321) [/quote] I didn't look up your cpu, but I think it's a revision F. Also, thanks for the /etc/sysconfig/cpuspeed "ondemand" tip. It seemed counterintuitive to explicitly specify the so-called default governor value (i.e., "empty defaults to ondemand"), but doing so did the trick under xen for my revision G AMD processor. Steve