Jump to content
funtoo forums
  • 0
Sandro

About Intel P-state

Question

Hello ... I have a system with Intel i7 4771 CPU (Haswell) @ 3.5 GHz.

In the kernel menuconfig I find "P-state" for Intel processors> = Sandy-Bridge.

 

Problem: If I install cpupower to change the governor and monitor frequency changes, cpupower not work ... then remains inactive (rc-update add cpupower default && rc)

Removing P-state by the kernel, cpupower works .......

 

I would like a bit 'deeper into this topic; and figure out what might be the most correct thing to do.

 

I also tried sys-power / ncpufreqd; but is the same than with cpupower.

 

Fedora kernel, have enabled P-state; and I can monitor the frequencies that scale from 800 MHz to 3.5 GHz ..

But fedora uses systemd ... and being ignorant of systemd I do not know how to move properly for Funtoo :(

 

How can I do with Funtoo to get the same result?

 

Thanks for any suggestions :)

Share this post


Link to post
Share on other sites

21 answers to this question

Recommended Posts

  • 0
# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

# CONFIG_CPU_FREQ_STAT is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=m

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

# CONFIG_CPU_FREQ_GOV_USERSPACE is not set

# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set

# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set

 

#

# CPU frequency scaling drivers

#

CONFIG_X86_INTEL_PSTATE=y

# CONFIG_X86_PCC_CPUFREQ is not set

# CONFIG_X86_ACPI_CPUFREQ is not set

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

# CONFIG_X86_P4_CLOCKMOD is not set

 

#

# shared options

#

# CONFIG_X86_SPEEDSTEP_LIB is not set

 

#

# CPU Idle

#

CONFIG_CPU_IDLE=y

# CONFIG_CPU_IDLE_GOV_LADDER is not set

CONFIG_CPU_IDLE_GOV_MENU=y

# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set

CONFIG_INTEL_IDLE=y

 

 

 

 # cpupower frequency-info

analyzing CPU 0:

  driver: intel_pstate

  CPUs which run at the same hardware frequency: 0

  CPUs which need to have their frequency coordinated by software: 0

  maximum transition latency:  Cannot determine or is not supported.

  hardware limits: 800 MHz - 3.90 GHz

  available cpufreq governors: performance powersave

  current policy: frequency should be within 800 MHz and 3.90 GHz.

                  The governor "powersave" may decide which speed to use

                  within this range.

  current CPU frequency: 895 MHz (asserted by call to hardware)

  boost state support:

    Supported: yes

    Active: yes

 

 

i do not have cpupower added to rc

Share this post


Link to post
Share on other sites
  • 0

Take a look about  those outputs and discussion (excuse me if it is in Italian):

 

What tells 

watch -n 0,5 'cat /proc/cpuinfo | grep "MHz"'

with your configuration ?

 

Or ... Do You use some other commands for looking real-time cpufreq with Intel P-state enabled ?

 

Thank You :)

Share this post


Link to post
Share on other sites
  • 0
Every 5.0s: cat /proc/cpuinfo | grep "MHz"                                                                      Fri Jul 15 18:43:12 2016

 

cpu MHz         : 3899.902

cpu MHz         : 3900.329

cpu MHz         : 3899.902

cpu MHz         : 3900.115

 

 

look at documentation - /usr/src/linux/Documentation/cpu-freq/

 

i disable acpi driver enable pstate and powersave gov and pstate works automatically.  googling pstate - it gets too technical for me.

i use cpupower frequency info and cpupower frequency set

Share this post


Link to post
Share on other sites
  • 0

Thanx Great;

 

Your command runs; but the frequency on my system, in "idle", are too high (i've imposed from 800 to 3900) but it vary from 3,5 to 3,9 GHz :|

 

This trouble is really difficult for me.

 

Sorry friend :(

Share this post


Link to post
Share on other sites
  • 0

However, for now, i think that in portage there aren't softwares to tune the cpu (may be with systemd ? but i hate systemd)

For me is "Pseudo-solved" this topic.

 

But is open for new ideas to have the best ratio performances / Watt.

 

Hello :)

Share this post


Link to post
Share on other sites
  • 0

Excuse me for third post .....

 

I've used boinc (that for me is the software which for me it is the most resource-hungry and also it raises more than anything else the temperatures of the cores) to test the 2 situations:

 

1) with Intel P-state enabled in kernel , with MATE DE, I obtain ~4300 for Weathston (fpu) per core and only ~ 10500 in Integer (Drystone). :o

2) Without Intel P-state fpu (Whetstone) is similar, but in integer (Dhrystone) is near 15000 MIPS per core

 

Then for this moment the choice is to use cpupower without P-state driver.

 

But that discussion is ever opened ..... Who knows what will happen in the future ?

 

Hi to All & great Dear whiteghost :)

Share this post


Link to post
Share on other sites
  • 0

I have an Intel i7-4770K and I use the kernel CPU Frequency scaling options without pstates and it works fine.  I set the default governor to "ondemand" in the kernel.  Each core then idles at 800MHz and scales up as needed.

 

I have cpupower installed on my system, but don't really need it as the kernel settings do what I desire.

Share this post


Link to post
Share on other sites
  • 0

@ Overkill : then you use in kernel as default the "ondemand" governor ?

@whiteghost : tomorrow i will make other experiments with i7z (01:23 in my town) i go to sleep now.

 

Thanx :)

Share this post


Link to post
Share on other sites
  • 0

May be that my cpu is bugged :|

 

Using i7z for monitoring cpu, using boinc is 35x (3500 MHz) if i compile kernel i7z tell to me that th cores runs at 37x (3700 MHz);

Globally there is not a very good scaling;

 

I return to cpupower without Intel P-state enabled "in kernel" :|

Share this post


Link to post
Share on other sites
  • 0

@ Overkill : then you use in kernel as default the "ondemand" governor ?

@whiteghost : tomorrow i will make other experiments with i7z (01:23 in my town) i go to sleep now.

 

Thanx :)

Yes, I use on demand.  Here you see it at work:

# grep MHz /proc/cpuinfo 
cpu MHz : 3501.000
cpu MHz : 800.000
cpu MHz : 800.000
cpu MHz : 1000.000

Share this post


Link to post
Share on other sites
  • 0

I have an Intel i7-4770K and I use the kernel CPU Frequency scaling options without pstates and it works fine.  I set the default governor to "ondemand" in the kernel.  Each core then idles at 800MHz and scales up as needed.

 

I have cpupower installed on my system, but don't really need it as the kernel settings do what I desire.

 

Dear Overkill .... also i use Intel P-state disabled and all runs correctly; The real trouble is: Why in Fedora 24 with P-state enabled there are not trouble about scaling cpu frequencies ? With Funtoo i must use Your solution with P-state disabled.

 

I'd like to have my cpu running under P-state mode correctly. But for now it seems impossible; if i activate P state for Intel, i've no great scaling and benching for example boinc i've better results with your method.

 

May be also that there are Intel's cpu with "a bug" about P-state .....

For example my i7 4771 doesn't accept updates for microcode; for example if I make

# service microcode_ctl start

The systems have  various errors .... :(

 

Excuse me ... hope not to have bored You :)

 

However ... my Funtoo Stable runs very very well :) my system is all "consistent" (in Italian ... "coerente") :)

Share this post


Link to post
Share on other sites
  • 0

Haswell  requires early microcode:

CONFIG_MICROCODE=yCONFIG_MICROCODE_INTEL=yCONFIG_MICROCODE_INTEL_EARLY=yCONFIG_MICROCODE_EARLY=y

https://wiki.gentoo.org/wiki/Intel_microcode

Follow software and configuration instruction.

Install microcode package, build tool and create microcode cpio image.

No initrd:

initrd /boot/early_ucode.cpio

Initrd:

initrd  /boot/early_ucode.cpio /boot/initramfs-debian-sources-x86_64-4.4.6-1

Share this post


Link to post
Share on other sites
  • 0

I'm on stable with gentoo-sources compiled with genkernel; I don't want Debian-sources and my situation is:

 

 

sandro@ci74771ht ~ $ uname -a
Linux ci74771ht 4.4.6-gentoo #1 SMP PREEMPT Mon Jul 18 21:13:38 CEST 2016 x86_64 Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz GenuineIntel GNU/Linux

 

 

sandro@ci74771ht ~ $ zgrep MICROCODE /proc/config.gz
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
sandro@ci74771ht ~ $ zgrep EARLY /proc/config.gz
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_GENERIC_EARLY_IOREMAP=y
CONFIG_SERIAL_EARLYCON=y
CONFIG_EARLY_PRINTK=y
# CONFIG_EARLY_PRINTK_DBGP is not set
CONFIG_EARLY_PRINTK_EFI=y

 

I must try with a newer version of gentoo-sources ?

 

Thanx

Share this post


Link to post
Share on other sites
  • 0

To accomplish what? I've been using gentoo sources with the same cpufreq kernel config for years. Are you trying to get pstates working or update your microcode? I'm not the one who knows how to do either :(
 

# uname -a
Linux kpd 4.4.15-gentoo #1 SMP Mon Jul 18 10:18:41 CDT 2016 x86_64 Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz GenuineIntel GNU/Linux

This is my i5 box, but it's the same config as my i7

Share this post


Link to post
Share on other sites
  • 0

@ Cardinal: i've tryed and execute all commands in your link; but doesn't work :|

At boot i've  kernel panic.

I'm returned with previous config.

 

Thanx for suggestions :)

 

And ... Enabling microcode_ctl system crashes :|

 

@ Overkill: np ... :)

Share this post


Link to post
Share on other sites
  • 0

@ Sandro

Remove microcode_ctl it doesn't work with haswell.

Linux 3.9?3.10 only:CONFIG_MICROCODE_INTEL_EARLY=yLinux 3.9-3.10 only:CONFIG_MICROCODE_EARLY=y

Your kernel is built to load early_ucode.cpio as initrd on boot:

Kernel-4.4.6

CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL
=y

Share this post


Link to post
Share on other sites
  • 0

Dear Cardinal: i've installed the microcode_ctl but it is not enabled in any runlevels.

 

I've with gento-sources-4.4.6:

sandro@ci74771ht ~ $ zgrep MICROCODE /proc/config.gz 
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y

Do You think that may be better to change the kernel with different version (type, older or newer) ?

 

Thanx a lot for Your aid :)

Share this post


Link to post
Share on other sites
  • 0

sandro, i think you are missing the point on pstate driver.

 

when i use i7z, it may show frequency maxed out at 3.9GHz, but c1 state shows 97 percent of processor is in halt state.

 

isn't that power saving?

 

for a long time i had microcode enabled in kernel and would see in dmesg something about microcode driver. 

 

i assumed it was working but there is more too it.

 

i use git-sources. i use method two from this page

https://fitzcarraldoblog.wordpress.com/2014/11/06/updating-intel-cpu-microcode-from-gentoo-linux/

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...