Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > sysctl cpu.hwfrequency reports slower CPU

sysctl cpu.hwfrequency reports slower CPU
Thread Tools
ehgradman
Fresh-Faced Recruit
Join Date: Oct 2003
Status: Offline
Reply With Quote
Oct 28, 2003, 06:21 AM
 
Upon reading that many users of the 12" Powerbook were experiencing poorer performance upon upgrading to 10.2.8, I ran sysctl hw.cpufrequency. I had not run this command prior to upgrading, but I do know that it now returns 533333332. I have an 867MHz 12" Powerbook. I followed instructions to zap my PRAM, to no avail.

I have now upgraded to Panther, and I find that sysctl hw.cpufrequency is still reading 533333332.

I'm not blown away by Panther's speed increases, and I suspect it may be that my processor is running at reduced speed.

And yes, I have verified that my Energy Saver system preference is set to run the processor at Highest speed. Interestingly enough, changing that setting to Reduced speed doesn't seem to affect the value reported by hw.cpufrequency.
     
entrox
Senior User
Join Date: Jan 2003
Location: Stuttgart, Germany
Status: Offline
Reply With Quote
Oct 28, 2003, 06:58 AM
 
I'd say the reporting is b0rken. All performance tools from Apple (CHUD) report the clock speed as 867 MHz on my Rev. A PowerBook. Although these /could/ be hardcoded, I wouldn't lose too much sweat over this one.
     
suthercd
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Oct 28, 2003, 08:24 AM
 
After a shut down, press the mmu reset button for 5 seconds, restart, CPU is reset to full speed.

Craig
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Oct 28, 2003, 08:25 AM
 
The reporting is borken. It's a known bug.
     
ehgradman  (op)
Fresh-Faced Recruit
Join Date: Oct 2003
Status: Offline
Reply With Quote
Oct 28, 2003, 10:48 PM
 
Originally posted by suthercd:
After a shut down, press the mmu reset button for 5 seconds, restart, CPU is reset to full speed.

Craig
Wow. To anyone else who is experiencing this problem (and I encourage you to check), follow the directions at http://docs.info.apple.com/article.html?artnum=14449

These are directions for resetting your PMU (power management unit), not MMU. I followed them, and my 12" Powerbook noticeably sped up. Recent concerns that my system was too slow have been resolved by this simple fix.

If you said that the reporting is broken, this is one instance where I can assure you it was not.
     
Musti
Dedicated MacNNer
Join Date: Jan 2001
Location: Montr�al, QC
Status: Offline
Reply With Quote
Oct 29, 2003, 01:13 AM
 
Originally posted by Angus_D:
The reporting is borken. It's a known bug.
Yep. Borken here too.

And happened under 10.2.8 as well.

http://discussions.info.apple.com/[email protected]

Ti 867 registering as 667. No problems performance-wise, and correct CHUD reporting. Wished for otherwise, the fan noise is bugging me. My Ti 667 was very quiet. Oh well.
     
buzzlabs
Fresh-Faced Recruit
Join Date: Nov 2003
Status: Offline
Reply With Quote
Nov 10, 2003, 04:43 PM
 
I'm seeing the same problem, and my machine *definitely* runs faster at 867Mhz than it does at 533. ;o)

It's not a psychological or perceived faster. I use my PowerBook way too much, every day. It's running faster.

I filed a bug with Apple via the ADC Bug Reporter.

Steve
     
CheesePuff
Professional Poster
Join Date: Jan 2002
Location: Rochester, NY
Status: Offline
Reply With Quote
Nov 10, 2003, 05:56 PM
 
It appears to happen mostly on laptops. I have a 1.47 GHz G4 card from OWC and it reports 146666663.
     
iohead
Registered User
Join Date: Jan 2003
Location: California
Status: Offline
Reply With Quote
Nov 10, 2003, 06:21 PM
 
Originally posted by CheesePuff:
It appears to happen mostly on laptops. I have a 1.47 GHz G4 card from OWC and it reports 146666663.
My bad - I initially read it as 9 digits (giga) instead of the 6 (mega) you wrote. It should be 9 digits after the 1 if it is reporting in Hz.
-A
     
iohead
Registered User
Join Date: Jan 2003
Location: California
Status: Offline
Reply With Quote
Nov 10, 2003, 06:23 PM
 
Originally posted by ehgradman:

I have now upgraded to Panther, and I find that sysctl hw.cpufrequency is still reading 533333332.
You should also see what the following sysctl entries show:

hw.cpufrequency_min
hw.cpufrequency_max

-A
     
redshifter
Fresh-Faced Recruit
Join Date: Nov 2001
Status: Offline
Reply With Quote
Nov 11, 2003, 03:36 AM
 
I checked the cpufrequency of my 1GHz TiBook running Panther (and previously updated to 10.2.8), and it was reporting 667MHz. I reset the PMU and it then reported 1GHz, as it should.

But now I just ran the sysctl command again and it's back to reporting 667MHz! I don't notice any significant speed loss, though. I'm starting to wonder if this is actually a reporting error.

However, my roommate has an identical TiBook that is still running 10.2.6. His cpufrequency is reported at 100000000.
     
Sarc
Mac Elite
Join Date: Sep 2001
Location: Chile
Status: Offline
Reply With Quote
Nov 11, 2003, 10:49 AM
 
how are your energy saver settings ? if you don't have them on Highest Performace, it scales down CPU speed.
:: frankenstein / lcd-less TiBook / 1GHz / radeon 9000 64MB / 1GB RAM / w/ext. 250GB fw drive / noname usb bluetooth dongle / d-link usb 2.0 pcmcia card / X.5.8
:: unibody macbook pro / 2.4 Ghz C2D / 6GB RAM / dell 2407wfp - X.6.3
     
redshifter
Fresh-Faced Recruit
Join Date: Nov 2001
Status: Offline
Reply With Quote
Nov 11, 2003, 03:49 PM
 
Originally posted by Sarc:
how are your energy saver settings ? if you don't have them on Highest Performace, it scales down CPU speed.
My energy saver settings are set to Highest for both battery and power adapter.
     
superlarry
Senior User
Join Date: Jan 2001
Location: california
Status: Offline
Reply With Quote
Nov 11, 2003, 04:31 PM
 
Originally posted by ehgradman:
Wow. To anyone else who is experiencing this problem (and I encourage you to check), follow the directions at http://docs.info.apple.com/article.html?artnum=14449

These are directions for resetting your PMU (power management unit), not MMU. I followed them, and my 12" Powerbook noticeably sped up. Recent concerns that my system was too slow have been resolved by this simple fix.

If you said that the reporting is broken, this is one instance where I can assure you it was not.
for what it's worth, my rev. a 12" was reporting 533 MHz with sysctl (min and max cpufrequency). i did this reset, and it's up to 867 again (cpufrequency as well as min and max). maybe this'll speed up xcode (i couldn't understand why it was so much slower than project builder.. this is probably why).
thanks, ehgradman!
     
peterb
Fresh-Faced Recruit
Join Date: Nov 2003
Status: Offline
Reply With Quote
Nov 11, 2003, 05:21 PM
 
Look. It's sysctl. It's a clunky BSDism that, in all likelihood, is advisory in nature only. Here's a simple test program:

#include <time.h>
#include <stdioh>

/* Note egregiously wrong function signature. I don't care. */
int main(int argc) {

int ix = 0;
time_t cur_time, start_time;

start_time = time(NULL);
while (1) {
ix++;
cur_time = time(NULL);
if ((cur_time - start_time) > 5) {
break;
}
}
printf("ix == %d\n", ix);

with the control panel/energy saver set to "highest performance":
cc -o foo foo.c
ibis% ./foo
ix == 1552778
ibis% ./foo
ix == 1307978
ibis% ./foo
ix == 1372959

with it set to "reduced performance":
ibis% ./foo
ix == 575880
ibis% ./foo
ix == 799495
ibis% ./foo
ix == 731467

In all cases, hw.cpufrequency reports the 53333332 value. Now, I fully acknowledge that my stupid little test program isn't checking the CPU frequency, but it does say that flipping the energy saver switch back and forth makes a difference.

OK, I just tried resetting my PMU. hw.cpufrequency is now correctly reporting 866666(etc), let's see what my goofy little test says (in both cases, pre and post PMU reset, I had an MP3 playing in the background, and a bittorrent download, so both of those are going to introduce variability)

ibis% ./foo
ix == 1631607
ibis% ./foo
ix == 1538479
ibis% ./foo
ix == 1682870

lowering speed to 'reduced'
ibis% ./foo
ix == 869355
ibis% ./foo
ix == 651244
ibis% ./foo
ix == 750992

I'd call those results inconclusive. I acknowledge that my testing regime is not rigorous, and i welcome more rigorous testing by someone with more free time :-)
     
buzzlabs
Fresh-Faced Recruit
Join Date: Nov 2003
Status: Offline
Reply With Quote
Nov 12, 2003, 02:57 AM
 
Here are some results of my investigation so far, and what I tend to believe:

- My 12" PowerBook feels faster when it's in "867" vs. "533" mode. For sure.

- I bet that the CPU is being throttled down, irrespective of the Energy Saver settings (at least the user-settable ones through the UI), and that the "Slower" setting or whatever just sets the max CPU speed.

- The reason Xbench, etc. benchmarks are as similar as they are probably has to do with the CPU kicking back up to maximum speed when needed, therefore providing consistent results.

- If you restart and hit Command-S to drop into single-user mode and immediately type "sysctl hw.cpufrequency", you get the 533 figure. It's either something that is happening in the kernel/power manager (in which case, it could be verifiable by checking out the Darwin 7.0 source code), else it could be something in Open Firmware/the PowerBook's firmware.

- I would personally really like the ability to set this; if it's a kernel-level thing instead of a firmware-level thing, it'd be nice to have "battery power" vs. "AC power" settings for this parameter. If it's OF, I'd love to know how to set it there.

I do not think that I am imagining the speed increase after much testing.

Steve
     
iohead
Registered User
Join Date: Jan 2003
Location: California
Status: Offline
Reply With Quote
Nov 12, 2003, 04:14 AM
 
Originally posted by buzzlabs:
- If you restart and hit Command-S to drop into single-user mode and immediately type "sysctl hw.cpufrequency", you get the 533 figure. It's either something that is happening in the kernel/power manager (in which case, it could be verifiable by checking out the Darwin 7.0 source code), else it could be something in Open Firmware/the PowerBook's firmware.
I think an Apple machine that supports multiple processor speeds *always* boots up with the slower frequency. On Gentoo Linux, for example (disclaimer: I've never used it myself), you actually have to set the higher frequency "manually" (by writing to a file in /proc). The appropriate (higher or lower) CPU frequency is "adjusted" once the OS is booted.

I might be wrong, BTW :-)

-A
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:20 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,