# Intel i7 3930-K Speed issues

## chromaf

Hi, I installed Gentoo via SystemRescueCD USB  key, and everything went pretty smooth. Now when I recompile the kernel to install the propietary NVIDIA graphics driver, the kernel compiling time is really SLOW compared to when I compile the kernel on the SystemRescueCD instance. I am pretty sure something is wrong with my kernel configuration but I don't know what exactly could be, I have checked the kernel config many times already. Compile time in the SRCD instance goes to 7 minutes, on my own running kernel goes up to more than one hour and a half. I monitorized with TOP on both while compiling , and while in the SRCD the core number 0 is being pushed to the max, about 87% constantly and the rest of the cores take 1 or 2% randomly, on my kernel it takes just like 2% of each core randomly.

my MAKEOPTS are -j14

Any hints on this ? Thank you.

----------

## albright

that's really bad

what cpu governor are you using 

(

```
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
```

)

----------

## chromaf

The output is really bad too I guess :

```
 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

powersave
```

----------

## albright

make sure the kernel is set to use ondemand governor

as default in the power management and acpi options

/ cpu frequency scaling section

IMO, the "help" advice is too conservative (where it says:

"in in doubt, say N" for ondemand ...

----------

## chromaf

Made the changes you suggested ... compiling now, will let you know. 

Now that makes sense, thank you !

----------

## chromaf

Recompiled kernel disabling powersave and set all options ondemand when I do 

```
cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor 

powersave

```

All CPU still appear on powersave. What Im doing wrong ?

----------

## albright

 *Quote:*   

> 
> 
> All CPU still appear on powersave. What Im doing wrong ?

 

as root, try 

```
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
```

I guess you should do that for all cpus (cpu0 thru, in you lucky case, cpu11) ...

if that works we can figure out why it's not automatically setting the right

governor ...

----------

## chromaf

```

echo "ondemand" >> /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

bash: echo: write error: Invalid argument

```

can't write it ... same happens when I open the file with nano. I guess it looks like it is not supported on the kernel ?

I compiled twice, made Bzimage and rebooted ... 

Thanks

----------

## sebB

Please post

```
cat /usr/src/linux/.config | grep CONFIG_CPU_FREQ
```

----------

## chromaf

```

speed cf # cat /usr/src/linux/.config | grep CONFIG_CPU_FREQ

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

CONFIG_CPU_FREQ_GOV_COMMON=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set

# CONFIG_CPU_FREQ_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

```

As you can see everything looks like its on demand ... 

Thanks !

----------

## sebB

And

```
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
```

Have you rebooted?

----------

## albright

also post

```
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
```

just to be sure ondemand is there

----------

## chromaf

```

speed cf # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

performance powersave

```

Thanks.

----------

## sebB

 *Quote:*   

> I compiled twice, made Bzimage and rebooted 

 

Have you installed the new Bzimage?

----------

## chromaf

I do this after compiling : 

```

speed boot # ls

bzImage

speed boot # cp bzImage /boot/kernel-3.10.7-gentoo

speed boot # 

```

Thanks

----------

## sebB

I think you forgot to mount your /boot partition.

Try this if you use grub1

```
mount /boot

cp /urc/src/linux/arch/x.../bzimage /boot/kernel-3.10.7-gentoo 

umount /boot

reboot
```

----------

## chromaf

Hi, mounted, copied and rebooted, all the output still the same ....   :Question: 

----------

## sebB

Are you using grub1 or grub2?

I'm confused with your other post

https://forums.gentoo.org/viewtopic-t-971264-start-0-postdays-0-postorder-asc-highlight-.html

See the wiki and the handbook for installing a new kernel

----------

## chromaf

I solved that problem already ... I was using a wrong arch stage. Now I am on a working install of amd64. I am using grub 2, not legacy.

Thanks

----------

## sebB

We can not help you if you're not more explicit.

You know you are using grub2 but you try to install bzimage like if you have grub1.

Looking at your other posts, I see that you do not read the messages of emerge and the logs.

See the handbook and the wiki. Everything is explained about how compiling and installing a kernel with grub2

http://wiki.gentoo.org/wiki/GRUB2

----------

## chromaf

I will ! Thank you

----------

## Yminus

Just in case someone with a similar problem finds this thread (like I did). 

My problem was that although all governors were compiled into the kernel, only "performance" and "powersave" were available. 

In my case it is because CONFIG_X86_INTEL_PSTATE is set:

```
grep CONFIG_X86_INTEL_PSTATE /usr/src/linux/.config

CONFIG_X86_INTEL_PSTATE=y
```

 *Quote:*   

> This driver provides a P state for Intel core processors.
> 
> The driver implements an internal governor and will become
> 
> the scaling driver and governor for Sandy bridge processors.
> ...

 

This also seems to apply to my Ivy bridge CPU, so I guess that's why the other governors are not showing up.

Btw, the P state governor works well and I will stick to it. I only came across this "issue" because an error showed up when I restarted laptop_mode:

```
sudo /etc/init.d/laptop_mode restart 

 * WARNING: you are stopping a boot service

 * Stopping laptop_mode ...

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument                      [ ok ]

 * Starting laptop_mode ...

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument

/usr/share/laptop-mode-tools/modules/cpufreq: line 11: echo: write error: Invalid argument                      [ ok ]
```

I resolved this by disabling frequency scaling in /etc/laptop-mode/conf.d/cpufreq.conf. I learned that my kernel already does frequency scaling.

----------

