Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CPU Frequency scaling problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Tonglebeak
Guru
Guru


Joined: 23 Mar 2006
Posts: 362

PostPosted: Sat Feb 23, 2008 10:28 pm    Post subject: CPU Frequency scaling problem Reply with quote

I have a 3200+ athlon64. The stock clock speed is 2.0ghz, but I've had it oc'd to 2.4 ever since I got it...

Today, I compiled in cpu scaling. For whatever reason, cpufreq is only detecting the stock clock speed, and setting it as the max, rather than detecting my overclock speed. So now my cpu will onlyi run 2ghz max instead of 2.4ghz (yes, it's still overclocked in bios).

Anyway to force cpufreq to use 2.4ghz as the max?
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sun Feb 24, 2008 1:53 am    Post subject: Reply with quote

Maybe CPUFREQ use the spec that are from /proc/cpuinfo.

I think that there is a way do overright your cpu speed manually.
Back to top
View user's profile Send private message
Yak
Tux's lil' helper
Tux's lil' helper


Joined: 01 Sep 2002
Posts: 107

PostPosted: Sun Feb 24, 2008 2:07 am    Post subject: Reply with quote

Have a look at the files in /sys/devices/system/cpu/cpu0/cpufreq/ if you haven't already. It should show the min, max, current, and available frequencies, and current and available governors. I've not had much luck with scaling an overclocked athlon64 so far, though.
Back to top
View user's profile Send private message
joaopft
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2003
Posts: 86
Location: Lisbon, Portugal

PostPosted: Mon Mar 31, 2008 11:07 pm    Post subject: Reply with quote

With cpufreq compiled in the kernel and an overclocked/underclocked processor, the processor clockspeed reported in /proc/cpuinfo is but a nominal value. This particular /proc/cpuinfo line gets used by userspace apps like Ksensors, etc, and is is very annoying having these apps report fictional clockspeed values...

For kernel 2.6.24 (64 bits) patch the kernel with the following to solve the issue:

Code:

--- linux/arch/x86/kernel/setup_64.c.old        2008-03-24 15:07:26.000000000 +0000
+++ linux/arch/x86/kernel/setup_64.c    2008-03-24 15:04:05.000000000 +0000
@@ -1098,8 +1098,12 @@

        if (cpu_has(c,X86_FEATURE_TSC)) {
                unsigned int freq = cpufreq_quick_get((unsigned)cpu);
+                static unsigned int nominal_max;
+                nominal_max = freq > nominal_max ? freq : nominal_max;
                if (!freq)
                        freq = cpu_khz;
+                else
+                        freq = (unsigned int) (freq * (1.0*cpu_khz)/nominal_max);
                seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
                             freq / 1000, (freq % 1000));
        }


To patch: make sure /usr/src/linux points to a 2.6.24 kernel;
create file /usr/src/cpufreqpatch-2.6.24 with the above code;
run

Code:

cd /usr/src
patch -p0 <cpufreqpatch-2.6.24


Now, recompile the kernel.

Notes: 1. This patch has no effect on a 32 bit kernel.
2. The patched kernel was (successfully) tested on two Athlon 64 systems.
3. I can't promise the patched kernel won't break your system
.
_________________
Fiction is obliged to stick to possibilities. Truth isn't.
Mark Twain
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum