5
Architecture:
**AMD** Opteron quad-core using 2 CPUs --- Numa system

Processor : x86_64 Operating System: GNU/Linux

I am trying to set the core freq to 2.2GHz(that being the max) on just one core of the die. The other die completely turned off.

sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu1/online"
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu3/online"
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu5/online"
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu7/online"

Therefore just the cores, 0,2,4,6 are turned on

I have tried changing the governor to performance but it changes the frequency of other cores' when any other thread runs on it. For example:

if thread one runs on core 0: then its freq is 2.2GHz

when thread two starts to run on core 2: it gets it as 2.2GHz - Where as I am expecting it to work as 0.8GHz.

is there a particular way to just set the frequency of just one core permanently.

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
user1860977
  • 89
  • 1
  • 6

3 Answers3

3

Following @Lars answer.

Here is the complete solution:

echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo userspace > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor

echo userspace > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor

echo userspace > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor

yum install cpufrequtils or sudo aptitude install cpufrequtils

Then,

sudo cpufreq-set -c 0 -f 2200Mhz

sudo cpufreq-set -c 2 -f 800Mhz

sudo cpufreq-set -c 4 -f 800Mhz

sudo cpufreq-set -c 6 -f 800Mhz

Let me know if i can be anymore help in this issue. thanks

user1860977
  • 89
  • 1
  • 6
1

You could try setting the governor to userspace (you may need to recompile your kernel if it isn't included) and then manually setting the frequency using scaling_setspeed.

Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204
  • Fortunately, the governor `userspace` is provided by my version of kernel and distribution. Can you expand on the later part? – user1860977 Nov 29 '12 at 09:49
  • Okay. quite simple. say `echo userspace > /sys/devices/system/cpu/cpuX/cpufreq/scaling_governor` where X is the core id `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` `cat /proc/cpuinfo | egrep 'processor|MHz'` – user1860977 Nov 29 '12 at 10:06
  • The `scaling_setspeed` file is in the same directory -- you should be able to echo the frequency you want into it (again it might be that this is not supported by your kernel). – Lars Kotthoff Nov 29 '12 at 10:11
0

this command might work if the "cpufreq-set" one is missing:

cpupower -c 0 frequency-set -f 800
Brant Olsen
  • 5,628
  • 5
  • 36
  • 53
Paul M
  • 290
  • 2
  • 12