Jump to content
323 posts in this topic

Recommended Posts

I have a 1.73 Ghz Core Duo and was wondering why my CPU-freq would display 2167 Mhz on high load.

 

"kern.cpu_maxfreq: 2167" seems to be the problem (see below):

 

sudo sysctl -a | grep freq
kern.exec: unknown type returned
hw.busfrequency = 532000000
hw.cpufrequency = 1730000000
hw.tbfrequency = 1000000000
kern.cputhrottle_curfreq: 800
kern.cputhrottle_freqs: 800 1067 1333 1733 
kern.cpu_currentfreq: 1000
kern.cpu_minfreq: 1000
kern.cpu_maxfreq: 2167
hw.busfrequency: 532000000
hw.busfrequency_min: 532000000
hw.busfrequency_max: 532000000
hw.cpufrequency: 1730000000
hw.cpufrequency_min: 1800000000
hw.cpufrequency_max: 1800000000
hw.tbfrequency: 1000000000

 

But when I try to change it by typing

 

"sudo sysctl -w kern.cpu_maxfreq=1733"

 

I always get:

 

"sysctl: oid 'kern.cpu_maxfreq' is read only"

 

I know this might be a dumb question, but how do I write to the various kern.cpu entries?

on manual switching with sysctl -w kern.cputhrottle_curfreq=xxx where xxx = 600,800,1000,1200,1700 the throttle will sometimes succeed and other times not.

 

How did you manage to write to the variable?

 

Everytime I am trying to modify either "kern.cputhrottle_curfreq" or "kern.cpu_maxfreq" I get:

 

"sysctl: oid 'kern.cpu_*' is read only"

Any ideas?

  • 2 weeks later...
http://www.hostclip.com/dl/e1f5facfa6fc0e90f00c48538c3fbecb

 

10.4.9 kernel for SSE3, hpet with speedstep. Oh, and I changed code for wake from sleep, had to make an hpet call to wake properly. Now I can sleep it for hours and it wakes in about 5 seconds.

 

Beat ya kiko ;)

 

The link doesn't work ;),,,

  • 3 weeks later...

When no kern.cputhrottle instances show up in dmesg output does that mean that:

 

1. Kernel speedstep failed

or

2. AppleIntelCPUPowermanagement.kext failed in recognizing available CPU frequencies?

 

Of course, ACPICPUThrottle.kext fails to load as well because of 1 or 2.

Console log says SpeedStep kernel extension failed to load (AppleIntelCPU....kext?)

 

I also have Core Duo 1.73 GHz.

 

sysctl -a | grep freq

Password:

kern.exec: unknown type returned

hw.busfrequency = 532000000

hw.cpufrequency = 1730000000

hw.tbfrequency = 1000000000

hw.busfrequency: 532000000

hw.busfrequency_min: 532000000

hw.busfrequency_max: 532000000

hw.cpufrequency: 1730000000

hw.cpufrequency_min: 1730000000

hw.cpufrequency_max: 1730000000

hw.tbfrequency: 1000000000

http://www.hostclip.com/dl/7d6b719485feb7050f3fff956f19f77d

 

This is 10.4.9 mach_kernel and the associated ACPICPUThrottle files.

 

Unzip this and you will get 1 file and 1 folder.

Move mach_kernel to /

Unzip the ACPICPUThrottle.zip and move the resulting folder to /Library/StartupItems

Reboot.

You'll get a prompt to repair permissions for the ACPICPUThrottle StartupItem.

Click the Fix button and reboot once more.

Upon the next login, run sysctl -a | grep throttle and look for lines such as:

kern.cputhrottle_curfreq: 800

kern.cputhrottle_verbose: 0

kern.cputhrottle_freqs: 800 1067 1333 1600 1867

If these lines don't show up, the ACPICPUThrottle.kext didn't load for some reason.

 

One thing to try is to turn OFF any speedstep related items in your bios.

Sometimes this causes OSX to not be able to throttle the cpu.

 

As far as I know, AppleIntelCPUPowermanagement.kext has no impact on Speedstep.

For the record though, this kext is loaded up on my laptop.

 

Good luck.

Paulicat.

Nope, it didn't work because of BIOS being "braindead"

 

I was trying to figure out this for the whole day and this is what I learned:

If BIOS doesn't report correct power states to ACPI or fails to do so, ACPICPUThrottle.kext fails to load. If BIOS doesn't reports correct powerstates to ACPI, that means that Windows are using magic tricks to throttle cpu. Not really. There is the other way to control powerstates on Enhanced SpeedStep CPUs (Pentium M, Core Duo, Core 2 Duo etc) and it's already implemented in ACPICPUThrottle.kext but it doesn't work because it pulls available powerstates from ACPI, which BIOS "forgot" to report. Since many laptops have this "braindead" BIOS, no wonder why so many people have this problem.

There is solution though.

 

Quick explanation:

"Intel Pentium M processors have circuitry for changing their clock frequency and input voltage on-the-fly. In addition to providing a large range of frequencies -- typically between 5 and 7, in contrast to earlier processors from Intel, which only had "fast" and "slow" speeds -- this "Enhanced SpeedStep" is easier to control, requiring only that a MSR (model-specific register) be manipulated, unlike earlier versions which required BIOS support." (c/p from http://www.daemonology.net/freebsd-est/ )

 

Edit: AMDs support this "direct drive" throttling too

 

It is possible (it's possible on windows and freebsd, I don't see a reason why

this wouldn't work on OS X...) to supply ACPICPUThrottle.kext with pre-defined CPU table with their characteristics -

available frequencies, just like this: .

 

Experts, what do you think?

ACPICPUThrottle: No valid CPUs returned by ACPI! It's possible your BIOS does not think your system should be throttled and therefore did not return any available power states, or maybe your CPU only supports one other power state than maximum which is below 1Ghz!

 

There is solution on the way though

 

:)

what solution?

If that error about one state below 1Ghz is from my kext then ignore it. I removed that artificial limitation a long time ago, but I probably forgot to remove that text.

What CPU do you have again??

 

Paulicat

 

EDIT, I just tried Kikos direct drive kext, it still has the fake 1ghz barrier in it.

Also, my kext has acpi code in it, but for kernels 10.4.8 and up, it will fail on acpi, but will procede to use DirectDrive also.

I'm not entirely sure of what Kiko put in his kext though.

Here's a copy/paste of dmesg after my kext is loaded on a core solo 1.87ghz:

ACPICPUThrottle: Adding CPU0

---> P0, 1867Mhz, 31000mW, 10us, 10us (ctrl=0xe2c, status=0xe2c)

---> P1, 1600Mhz, 26000mW, 10us, 10us (ctrl=0xc26, status=0xc26)

---> P2, 1333Mhz, 22000mW, 10us, 10us (ctrl=0xa20, status=0xa20)

---> P3, 1067Mhz, 17000mW, 10us, 10us (ctrl=0x81a, status=0x81a)

---> P4, 800Mhz, 13000mW, 10us, 10us (ctrl=0x613, status=0x613)

ACPICPUThrottle: Using direct drive of Intel throttling

Aug 19 16:23:55 s-computer kernel[0]: ACPICPUThrottle: Adding CPU1

Aug 19 16:23:55 s-computer kernel[0]: ACPICPUThrottle: Adding CPU2

Aug 19 16:23:55 s-computer kernel[0]: ACPICPUThrottle: No valid CPUs returned by ACPI! It's...

 

No throttle in dmesg output...

 

I have Core Duo T2250 @ 1.73 GHz. Correct me if I'm wrong but from your dmesg output it's clear that kext is using ACPI to get powerstates

 

From Intel® 64 and IA-32 Architectures

Software Developer’s Manual

Volume 3A:

System Programming Guide, Part 1

 

The Advanced Configuration and Power Interface (ACPI) defines performance states

(P-state) that are used facilitate system software’s ability to manage processor

power consumption. Different P-state correspond to different performance levels

that are applied while the processor is actively executing instructions. Enhanced Intel

SpeedStep Technology supports P-state by providing software interfaces that control

the operating frequency and voltage of a processor.

 

This is probable cause of my problem:

 

A BIOS (following ACPI 3.0 specification) can choose to expose P-state as dependent

and hardware-coordinated to OS power management (OSPM) policy.

 

Which my BIOS obvioulsy don't

Actually no, from my paste, the last line tells you that its using DirectDrive to control the cpu states.

As of 10.4.8 there is 0 support for acpi throttle states. It will always use DirectDrive.

 

I've attached a debug build of my kext.

Please post the dmesg from: "ACPI CPU Throttle loaded"

 

What laptop do you have by the way?

 

Paulicat.

ACPICPUThrottle.kext.zip

Asus F3jc

 

ACPICPUThrottle: Adding CPU1

ACPICPUThrottle: Failed with code -536870212

ACPICPUThrottle: Adding CPU2

ACPICPUThrottle: Failed with code -536870212

ACPICPUThrottle: No valid CPUs returned by ACPI! It's possible.......

 

Edit: Is it possible that BIOS disables IA32_MISC_ENABLE MSR ?

×
×
  • Create New...