You are not logged in.

#1 2014-08-23 02:38:59

colinh
Member
Registered: 2014-08-23
Posts: 19

99% C7 state for i7 processor, but T = 70 deg C

Hi,

I've just installed Arch (single boot) on an "Early 2011" Macbook Pro (15") Model 8,2 with the the 2.2 GHz quad-core (2720QM) Intel Core i7 Sandy Bridge CPU, Radeon HD 6750M GPU and a Samsung SSD.

i7z is reporting that while idling (running fvwm, firefox and a couple of xterms) all the processors are mostly over 99% in the C7 state. I'd have expected the temperature to be near ambient if that were so, but the temperature of all 4 cores is hovering around 70 deg C. It went up to 80 deg when Thunderbird was running and downloading all my old email.

The fans are on maximum (6200 rpm).

The governor is "ondemand".

Hmm. The "Actual Frequency" was at around 2.2 GHz.

echo 25 > /sys/devices/system/cpu/intel_pstate/min_perf_pct

has resulted in the frequencies dropping to about 850 MHz, and T dropping to 65 deg C.


I haven't investigated all power/frequency options yet, or configured thermald, but isn't there something fundamentally wrong here?

Offline

#2 2014-08-23 03:37:40

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: 99% C7 state for i7 processor, but T = 70 deg C

Does it improve when using the Intel P-State driver?

Offline

#3 2014-08-23 08:57:11

Jojonintendo
Member
Registered: 2013-12-06
Posts: 56

Re: 99% C7 state for i7 processor, but T = 70 deg C

If at 850 MHz it stays at 65ºC, that might be a software misreading, or dust inside the Macbook. I have an AMD laptop with similar specs, and it idles at 30-40ºC.


M/B: Asus M5A97 LE R2.0 CPU: AMD FX(tm)-6100 Six-Core Processor GPU: XFX R9 390 DD Black Edition RAM: Kingston HyperX Beast DDR3 1866 2X4GB SSD: Crucial M4 128GB SATA 3
CPU and GPU are watercooled by Ibercool kit.

Offline

#4 2014-08-23 09:22:44

somearchfan
Member
Registered: 2014-08-18
Posts: 35

Re: 99% C7 state for i7 processor, but T = 70 deg C

colinh wrote:

Hi,

I've just installed Arch (single boot) on an "Early 2011" Macbook Pro (15") Model 8,2 with the the 2.2 GHz quad-core (2720QM) Intel Core i7 Sandy Bridge CPU, Radeon HD 6750M GPU and a Samsung SSD.

i7z is reporting that while idling (running fvwm, firefox and a couple of xterms) all the processors are mostly over 99% in the C7 state. I'd have expected the temperature to be near ambient if that were so, but the temperature of all 4 cores is hovering around 70 deg C. It went up to 80 deg when Thunderbird was running and downloading all my old email.

The fans are on maximum (6200 rpm).

The governor is "ondemand".

Hmm. The "Actual Frequency" was at around 2.2 GHz.

echo 25 > /sys/devices/system/cpu/intel_pstate/min_perf_pct

has resulted in the frequencies dropping to about 850 MHz, and T dropping to 65 deg C.


I haven't investigated all power/frequency options yet, or configured thermald, but isn't there something fundamentally wrong here?

Sadly that's a common problem with macbooks as they get older. My Macbook Pro Retina idles at around 80C and throttles down to 800 MHz everytime a watch video on youtube. Already cleaned the fans, replaced the thermal paste. Nope, no change at all. I'm using a cooling pad now, to keep temperatures down with moderate success. Throttling has now decreased to 1200 MHz on average.

One thing you could try is to disable turboboost.

Even P State behavior mentioned above can be influenced with /sys/devices/system/cpu/intel_pstate, e.g. Intel Turbo Boost can be deactivated with # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo for keeping CPU-Temperatures low.

https://wiki.archlinux.org/index.php/CP … cy_scaling

Offline

#5 2014-08-23 22:13:56

colinh
Member
Registered: 2014-08-23
Posts: 19

Re: 99% C7 state for i7 processor, but T = 70 deg C

I haven't looked at the P-state driver yet - unless using it means # echo xxx > /sys/devices/system/cpu/intel_pstate/yyy.

Yes, I did try disabling turbo boost (# echo 1 > no_turbo) and it's what I used to get the frequency down as described in the first post (echo 25 > min_perf_pct). Reducing the frequency helped in reducing T by a few degrees.


I've been looking at MSRs, datasheets (always not quite sure I've got the right one :-) , and the commands i7z, sensors and rdmsr/wrmsr.

According to Intel 64-IA-32-Architectures Software Develop Manual  Vol 3C, Chapter 35, page 84

MSRs 1016-1018 show MSR_PKG_C[3,6,7]_RESIDENCY

Running rdmsr a few times showed the C6 (SIX!) residency going up much faster than C3. And C7 not moving at all.

But looking at 1020-1022 for  MSR_CORE_C[3,6 and presumably 7]_RESIDENCY showed that C3 was creeping up, C6 stationary and C7 going up really fast - just what is shown by i7z.


Anyway, from the Mobile 3rd generation Core i7 datasheet:

4.2.4.6 C-state Auto-Demotion

In general, deeper C-states such as C6 or C7 have long latencies and have higher
energy entry / exit costs. The resulting performance and energy penalties become
significant when the entry / exit frequency of a deeper C-state is high.
Therefore,
incorrect or inefficient usage of deeper C-states have a negative impact on battery life.
To increase residency and improve battery life in deeper C-states, the processor
supports C-state auto-demotion.


Maybe that has something to do with it?


I don't think it has anything to do with my Mac being 3 yrs old. Core i7s don't get older in MacBook Pros than they do in other laptops. Well, maybe they do, but they don't age faster. :-) I'd have to swap the SSD to boot into Mac OS X again - but I don't recall it getting so hot and having the fan running loud all the time.

Offline

#6 2014-08-24 00:08:33

mwillems
Member
Registered: 2014-08-09
Posts: 89

Re: 99% C7 state for i7 processor, but T = 70 deg C

You might want to try changing your governor; my understanding is that the ondemand governor is deprecated on Sandy Bridge and newer intel processors because it does a poor job of scaling with modern intel architectures.   According to this article, the kernel developers determined that ondemand is actually counterproductive with modern processors.  Per the wiki, the default governor for those CPUs is now powersave, and I don't think p-state even offers ondemand as an option anymore. 

I recently switched one of my systems from Debian stable to Arch, and cpupower claimed my CPU didn't support ondemand and refused to allow me to set the governor to anything other than powersave or performance, even though the exact same processor had been configured for ondemand using cpufrequtils in Debian the previous week.  I was vexed until I noticed that p-state works differently and doesn't offer the same governors as ACPI cpu-freq.  It runs cooler now, and I've noticed no change in responsiveness FWIW.

Last edited by mwillems (2014-08-24 00:26:25)

Offline

#7 2014-08-24 03:34:25

colinh
Member
Registered: 2014-08-23
Posts: 19

Re: 99% C7 state for i7 processor, but T = 70 deg C

The frequency scaling governor was indeed set to performance.

In accordance with the Arch wiki page on frequency scaling, I edited /etc/default/cpupower and did # systemctl enable cpupower.service.

Oddly enough, after a reboot # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor STILL showed 'performance'.

I changed it using # cpupower frequency-set -g powersave but the temperature hasn't changed, unfortunately.



Regarding my last post, I've finally zeroed in on the i7-2720QM being a "2nd generation Intel Core Processor, Family Mobile", with a post Nehalem, SandyBridge architecture, so now I'm looking in the right datasheets and tables :-)

Quoting the full section of the datasheet this time,

4.2.4.6 C-State Auto-Demotion

In general, deeper C-states such as C6 or C7 have long latencies and have higher
energy entry/exit costs. The resulting performance and energy penalties become
significant when the entry/exit frequency of a deeper C-state is high. Therefore,
incorrect or inefficient usage of deeper C-states have a negative impact on battery life.
To increase residency and improve battery life in deeper C-states, the processor
supports C-state auto-demotion.

There are two C-State auto-demotion options:
# C7/C6 to C3
# C7/C6/C3 To C1

The decision to demote a core from C6/C7 to C3 or C3/C6/C7 to C1 is based on each
core's immediate residency history. Upon each core C6/C7 request, the core C-state is
demoted to C3 or C1 until a sufficient amount of residency has been established. At
that point, a core is allowed to go into C3/C6 or C7. Each option can be run
concurrently or individually.

This feature is disabled by default. BIOS must enable it in the
PMG_CST_CONFIG_CONTROL (sic) register. The auto-demotion policy is also configured by
this register.

Anyway, as it stands # rdmsr 0xE2 reports 0x404 for the PKG_CST_CONFIG_CONTROL msr (described in Vol. 3C, 35-111 (p.3227) of the Intel doc, which means that auto-demotion and undemotion are indeed NOT enabled.

The description for that MSR refers to http://biosbits.org which funnily enough shows "C-state residency - a case study" on its 'Screenshot Tour' page.

According to that, MSR 0xE2 = 0x1e000407 (ie auto demotion and undemotion enabled, and no package limits on C-state) would be the 'fixed' setting.


Since setting this MSR using wrmsr and setting the governor to powersave using cpupower have made ZERO difference to the temperature I'm wondering if all the references to BIOS are relevant...

... I'll try booting Intel's BITS from a CD tomorrow.

The Intel BIOS Implementation Test Suite (BITS) provides a bootable pre-OS environment for testing BIOSes and in particular their initialization of Intel processors, hardware, and technologies. BITS can verify your BIOS against many Intel recommendations. In addition, BITS includes Intel's official reference code as provided to BIOS, which you can use to override your BIOS's hardware initialization with a known-good configuration, and then boot an OS.

Last edited by colinh (2014-08-24 03:36:45)

Offline

#8 2014-08-24 04:34:15

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: 99% C7 state for i7 processor, but T = 70 deg C

Any chance you could test this on MacOS? It would be odd if Apple's OS where misbehaving as well.

Last edited by Pse (2014-08-24 04:34:31)

Offline

#9 2014-08-24 09:26:45

colinh
Member
Registered: 2014-08-23
Posts: 19

Re: 99% C7 state for i7 processor, but T = 70 deg C

OK, I swapped SSDs and booted OS X 10.9.4.

iStat shows T cpu and T gpu  around 40 ºC so that seems OK.


I found something called DirectHW for Mac OS X:

DirectHW is a software compatibility layer for Mac OS X. It provides a kernel driver and framework that emulates the most commonly used hardware access functions on x86 machines, such as:

    iopl
    inb, inw, inl, outb, outw, outl
    rdmsr, wrmsr
    mmap() of physical address space

This package was originally intended to get coreboot utilities running on Mac OS X. You're encouraged to use it for many more opportunities.

... but I haven't managed to compile it yet, possibly due to Xcode having switched from gcc to clang.

I've installed MacPorts and gcc-apple-4.2 but – no success yet :-/

Offline

#10 2014-08-24 17:31:31

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: 99% C7 state for i7 processor, but T = 70 deg C

Hmm, if this is a hardware initialization issue, I guess you could get more help in the kernel mailing list. I'm not sure if there is a specific list for Intel powersaving matters.

Offline

Board footer

Powered by FluxBB