Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo and i7 sandy bridge with turbo boost
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
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Thu Aug 02, 2012 7:25 pm    Post subject: Gentoo and i7 sandy bridge with turbo boost Reply with quote

Hello,

my cpu is i7 2600 3.4GHz stock, max 4.2Ghz with turbo boost (4.2GHz - 1core, 4.0 2cores, 3.9-all cores).

cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
returns 3401000

Does it mean that my cpu run at that speed or, what i think is right, that gentoo only reports that turbo boost was on (that 1) and i cannot determine real frequency. I'm asking to be sure, that I'm getting all that i can from this rig.

Thanks!
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 514
Location: San Diego, California USA

PostPosted: Thu Aug 02, 2012 7:34 pm    Post subject: Reply with quote

I'm not sure you can directly see the turbo boost numbers. Do you have the CPU frequency stuff turned on in the kernel? If so, you can get information for each "CPU" in the system.

Code:

$ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
3401000 1870423
3400000 24155
3300000 17158
3200000 17398
3100000 21504
3000000 15002
2900000 19560
2800000 14144
2700000 15769
2600000 12017
2500000 12041
2400000 15470
2300000 12035
2200000 14898
2100000 67065
1600000 72200830


That's on my 'Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz'. Notice there's a "3401000" entry and a "3400000" entry. I'm assuming the first one means "greater than 3.4GHz" which would imply the turbo boost.

The first column is the frequency and the second column is the number of ticks in each clock state.
Back to top
View user's profile Send private message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Thu Aug 02, 2012 8:01 pm    Post subject: Reply with quote

Ok, so let's assume that turbo boost works fine. But: what about processor states? Do idling cores turn off preventing heat & power consumption? Again, how to check it?
Back to top
View user's profile Send private message
megaflow
n00b
n00b


Joined: 11 Mar 2005
Posts: 60
Location: Maasmechelen

PostPosted: Thu Aug 02, 2012 9:25 pm    Post subject: Reply with quote

the app app-benchmarks/i7z will give u good info
_________________
----------------------------
Dell System XPS L702X/0XN71K,Intel(R) Core(TM) i7-2720QM
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Fri Aug 03, 2012 6:15 am    Post subject: Reply with quote

sys-power/powertop will tell you as well (the 2.0 version will give you more info)
Back to top
View user's profile Send private message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Fri Aug 03, 2012 7:25 am    Post subject: Reply with quote

Quote:
Cn Avg residency P-states (frequencies)
C0 (cpu running) ( 0.6%)
polling 0.0ms ( 0.0%)
C1 mwait 0.1ms ( 1.3%)
C2 mwait 1.3ms ( 0.1%)
C3 mwait 13.1ms (98.0%)


It also suggest me some things. Should I do it?
Suggestion: Enable the CONFIG_SND_AC97_POWER_SAVE kernel configuration option.
This option will automatically power down your sound codec when not in use,
and can save approximately half a Watt of power.
Q - Quit R - Refresh

No detailed statistics available; please enable the CONFIG_TIMER_STATS kernel option
This option is located in the Kernel Debugging section of menuconfig
(which is CONFIG_DEBUG_KERNEL=y in the config file)
Note: this is only available in 2.6.21 and later kernels


Wakeups-from-idle per second : 343.9 interval: 15.0s (so many?)


i7z tells me that
"True frequency (without accounting TUrbo) is 3400Mhz. So it means that turbo is on i think.

But I don't think it's detailed info because:
Quote:
i7z DEBUG: i7z version: svn-r77-(20-Nov-2011)
i7z DEBUG: Found Intel Processor
i7z DEBUG: Stepping 7
i7z DEBUG: Model a
i7z DEBUG: Family 6
i7z DEBUG: Processor Type 0
i7z DEBUG: Extended Model 2
i7z DEBUG: msr = Model Specific Register
i7z DEBUG: Detected an i3/i5/i7 - 32nm (sandy bridge - 2nd generation
i7z DEBUG: msr device files DONOT exist, trying out a m
mknod: `/dev/cpu/0/cpuid': File exists
mknod: `/dev/cpu/1/cpuid': File exists
mknod: `/dev/cpu/2/cpuid': File exists
mknod: `/dev/cpu/3/cpuid': File exists
mknod: `/dev/cpu/4/cpuid': File exists
mknod: `/dev/cpu/5/cpuid': File exists
mknod: `/dev/cpu/6/cpuid': File exists
mknod: `/dev/cpu/7/cpuid': File exists
i7z DEBUG: modprobbing for msr
FATAL: Module msr not found.
FATAL: Module msr not found.

------------------------------
--[core id]--- Other information
-------------------------------------
--[0] Processor number 0
--[0] Socket number/Hyperthreaded Sibling number 0,4
--[0] Core id number 0
--[0] Display core in i7z Tool: Yes

--[1] Processor number 1
--[1] Socket number/Hyperthreaded Sibling number 0,5
--[1] Core id number 1
--[1] Display core in i7z Tool: Yes

--[2] Processor number 2
--[2] Socket number/Hyperthreaded Sibling number 0,6
--[2] Core id number 2
--[2] Display core in i7z Tool: Yes

--[3] Processor number 3
--[3] Socket number/Hyperthreaded Sibling number 0,7
--[3] Core id number 3
--[3] Display core in i7z Tool: Yes

--[4] Processor number 4
--[4] Socket number/Hyperthreaded Sibling number 0,0
--[4] Core id number 0
--[4] Display core in i7z Tool: No

--[5] Processor number 5
--[5] Socket number/Hyperthreaded Sibling number 0,1
--[5] Core id number 1
--[5] Display core in i7z Tool: No

--[6] Processor number 6
--[6] Socket number/Hyperthreaded Sibling number 0,2
--[6] Core id number 2
--[6] Display core in i7z Tool: No

--[7] Processor number 7
--[7] Socket number/Hyperthreaded Sibling number 0,3
--[7] Core id number 3
--[7] Display core in i7z Tool: No

Socket-0 [num of cpus 4 physical 4 logical 8] 0,1,2,3,
Socket-1 [num of cpus 0 physical 0 logical 0]
GUI has been Turned ON
Logging is OFF
i7z DEBUG: Single Socket Detected
i7z DEBUG: In i7z Single_Socket()
i7z DEBUG: guessing Sandy Bridge
Quitting i7z



Wakeups-from-idle per second : 783.0 interval: 15.0s
It's red. I think it's bad. My governor is "ondemand" in both fields (i think one was present in processor tab, the other on the bottom of general menuconfig). How to lower that thing?
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Fri Aug 03, 2012 10:13 am    Post subject: Reply with quote

Enabling AC97 power saving will probably save power, the downside is that some apps may not wake the hardware correctly (in which case you'll get no sound). Also, depending on your hardware, you might get annoying loud clicks when the hardware wakes. The only way to know is to give it a try.

If you want detailed stats from powertop, enable the CONFIG options it suggests. It won't hurt. Also, it looks like you're running powertop 1.0? Try 2.0 (it's in testing but it should work fine on a stable system).

I don't know i7z, but it seems to be complaining it can't access model specific registers. Try enabling the CONFIG_X86_MSR for your kernel (it's in processor type and features).
Back to top
View user's profile Send private message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Fri Aug 03, 2012 12:03 pm    Post subject: Reply with quote

Weird, but the system doesn't seem to use more thatn 25% of cpu power anytime, even during kernel compilation: is there any benchmark that could prove me wrong? Maybe haven? I downloaded haven.run but i don't really know how to run it... permission denied always.
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Fri Aug 03, 2012 1:30 pm    Post subject: Reply with quote

kernel compilation won't use > 1 processor unless you tell it to.. try using "make -j8" to build the kernel.

Same goes for portage, good settings to maximise your machine usage for emerge in make.conf are:
Code:
EMERGE_DEFAULT_OPTS="--jobs=3"
MAKEOPTS="-j9 -l8"

The --jobs==3 tells portage to emerge up to three packages in parallel. This is good because only the compilation stage of an emerge can use more than one processor. The MAKEOPTS allow the compilation stage of each emerge to run up to 9 tasks in parallel, but not to start new tasks if the load average is above 8. That last is important because it prevents parallel emerges from thrashing the system.. you'll only get about 8 make processes total, instead of 3 * 9 = 27.

BTW 300 wakeups/sec is normal for an active i7 desktop. If you want to see what's causing the wakeups, you need to build your kernel with timerstats.
Back to top
View user's profile Send private message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Fri Aug 03, 2012 3:12 pm    Post subject: Reply with quote

It seems i've made it already. But are the other settings okay? It's really slow.

/etc/make.conf
Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="-gtk -gnome gt4 kde dvd alsa cdr mmx sse sse2
consolekit dbus policykit udev"
EMERGE_DEFAULT_OPTS="--jobs 8 --load-average 16"
MAKEOPTS="-j9 -l16"
PORT_LOGDIR="var/log/portage"
CLEAN_DELAY="2"
PORTAGE_NICENESS="19"
PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
AUTOCLEAN="yes"
INPUT_DEVICES="evdev keyboard mouse"
VIDEO_CARDS="nvidia"
LINGUAS="pl en_US"


And /etc/portage/make.conf
Code:
## These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="-gtk -gnome gt4 kde dvd alsa cdr mmx sse sse2"
EMERGE_DEFAULT_OPTS="--jobs 8 --load-average 16"
MAKEOPTS="-j9 -l16"
PORT_LOGDIR="var/log/portage"
CLEAN_DELAY="2"
PORTAGE_NICENESS="19"
PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
AUTOCLEAN="yes"
VIDEO_CARDS="nouveau"
INPUT_DEVICES="evdev keyboard mouse"



Does this wakeups wear cpu's somehow? Or it's just energy-related? Do you happen to know how many wakeups does windows 7 (sorry :) ) make? One more thing: what about voltages? How to check if cpu voltage is reduced when idle? This powertop should show me that too, yes? But I have misconfigured my kernel so it can't do that now i guess.
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Fri Aug 03, 2012 5:31 pm    Post subject: Reply with quote

kbzium wrote:
It seems i've made it already. But are the other settings okay? It's really slow.


"It's really slow" is not an easy description to work with. A 3.4GHz core i7 is anything but slow, it's a beast. Maybe your expectations are a bit out of whack, compiling takes time. Compiling big packages takes quite a lot of time. But:

Having --load-average 16 will only slow things down. You only have 8 cores. You are letting make run twice as many processes as you have cores available to service them. You are reducing throughput this way.
Having ionice -c 3 is only letting portage do disk IO when there has been no other IO for a grace period. Really not at all what you want, if you want portage to go faster. Get rid of the ionice setting altogether, the kernel manages io priority by itself just fine.
Having portage niceness at 19 gives portage processes the lowest possible priority. 5 would be more reasonable, if you just want it not to impact too much on your desktop.

Quote:
Does this wakeups wear cpu's somehow? Or it's just energy-related? Do you happen to know how many wakeups does windows 7 (sorry :) ) make? One more thing: what about voltages? How to check if cpu voltage is reduced when idle? This powertop should show me that too, yes? But I have misconfigured my kernel so it can't do that now i guess.


In practice you can't wear a CPU unless you overtweak it into toast. Minimising wakeups is about saving power. If you're not running off a battery, it's not all that important. Your numbers are fine, anyway. It is completely pointless to try to compare windows and linux in terms of wakeups/sec.

You haven't misconfigured your kernel, it's just that powertop needs special settings. I don't know about reduced voltages, I have a pre-sandybridge i7 myself.
Back to top
View user's profile Send private message
JanR
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2007
Posts: 78

PostPosted: Sat Aug 04, 2012 8:57 am    Post subject: Reply with quote

Hi,

first: Intel CPUs offer Turbo boost hidden as the highest P-State. In your case 3400 (I leave out the remaining 3 Zeros in this post) is 3.4 GHz - your default frequency in no-turbo-mode. All lower frequencies are the lower P-states. The remaining one is max+1 MHz, in your case 3401. This is "enable turbo". It does NOT tell you a which frequency it will run but it enables turbo and let the hardware decide.

By selecting this p-state you enable turbo (which seems to be the case for you).

Second: There is a tool called "turbostat" hidden in the tools-directory of the Linux kernel. Build this and you will see detailled statistics on turbo (updated every 10 s). Let it run and start load with different degrees of parallelism - you will see the individual states. Keep in mind that the highest state is only selected if really nothing else is running - this is nearly never the case with modern GUIs. Disable X and try it on console - this will give you much higher boost.

As your CPU seems to be overclocked (normal max turbo state for 2600K is 3.8 GHz, not 4.2) I'm not sure what turbostat will show.

Third: There is a great utility called "mhz" belonging to the very old "lmbench" (dropped from portage years ago but you can just download and build it). This one does not try to read some MSR etc. but runs a test that quite successful figures out the real frequency of the CPU. From my experience, it worked on every machine I tried (except P4 Northwood, here you get two times the frequency which is not that wrong as Northwood runs the ALU at that speed). On a multi-core system, it is better to taskset it to one core.

Example:

Code:

taskset -c 0 mhz
3603 MHz, 0.2775 nanosec clock


This is full single core turbo on my Xeon X3470.

Greetings,

Jan
Back to top
View user's profile Send private message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Sat Aug 04, 2012 9:30 am    Post subject: Reply with quote

Thank you, you made it a lot clearer. But what about voltages? Does it also let processor (or bios) decide? I don't want my i7 running at 1.2V at 1600MHz, cause it normally runs at 0.9V then. That would be my last concern, if my "wakeups-per-second" are good too.

Moreover, do you happen to know what kernel options should I enable in order to fully monitor my CPU yet not let it be destroyed anyhow? Now i cannot display detailed things like temperature and so on.

// edit:
Kernel compilation still uses only 1 tread/core. up to 15%... Any ideas? I've changed those two options.
Back to top
View user's profile Send private message
JanR
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2007
Posts: 78

PostPosted: Mon Aug 06, 2012 7:12 am    Post subject: Reply with quote

Hi,

Quote:

But what about voltages? Does it also let processor (or bios) decide? I don't want my i7 running at 1.2V at 1600MHz, cause it normally runs at 0.9V then.


As long as you don't mess with some strange kernel patches or play with the MSR on your own, the CPU will do it on your own. Changing voltage in BIOS, however, MAY influence the way the hardware control works (but this applies to any OS, not just Linux).

And: Don't look at frequency! Even if permanently set to full frequency, the CPU will enter C6 (if enabled) and completely turn off the cores. In this case, frequency and voltage do not matter.

Look at the C6 columns of turbo-stat. In case of an completely idle system, all cores should spend most of the time in C6.

Quote:

Moreover, do you happen to know what kernel options should I enable in order to fully monitor my CPU yet not let it be destroyed anyhow? Now i cannot display detailed things like temperature and so on.


Emerge the lm_sensors package. In order to support all that, you need the appropriate sensor for Intel CPUs (if I remember correctly, it is called "CORETEMP" - you find that in the hardware monitoring section of device drivers in the kernel configuration). If you enable that (and load the module, if build as module) "sensors" will read the internal sensors of the CPU. These values will be significantly higher than the values reported by the (external to CPU) sensors of the mainboard. For your CPU, everything up to the lower 80s (celsius) should be okay for high load. Second, for reading voltage and temperature sensors of mainboard you need the right sensor modules for YOUR board. Best is here to try or to google for lm_sensors and your board. Please keep in mind that these values may not be correct.


Quote:

Kernel compilation still uses only 1 tread/core. up to 15%... Any ideas? I've changed those two options.


Are you sure that you know how to compile a kernel?

Make clear that the kernel source is not yet compiled ("make clean" will erase everything leftover from last run), make sure, that all cores are enabled in Linux (count the output blocks of "cat /proc/cpuinfo) and run make with the right parameter. In your case, "make -j16" should do, minimum should be 8. That will give you full load for at least one minute on all cores if you have a rather minimalistic configuration.

Greetings,

Jan
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