Question about p-states (CPU frequency stepping)

Hello! New at Haiku here. Tried the first beta a long ago, looked interesting to me. Now I’m trying again and I’m delighted to see how much things have improved over the years! Specially on the hardware support.

I got an old subnetbook (Acer AO532h) to turn it into a Haiku machine to play with and everything but the webcam works, which is amazing. However I noticed it runs noticeably hotter than with windows. These notebooks usually have subpar heat dissipation (basically just a metal plate with a small fan, no copper at all) so it idles at like 50°C and go up to 70°C with load. At that point the bottom case gets very hot, which is kinda uncomfortable.

Now, looking at the tracker, I don’t think the problem arises at the CPU load (the idle threads are almost always around 100%) but rather that the CPU frequency is not stepping down but running at full speed all the time. Unfortunately I have no means to check it in the current release of Haiku.

I’ve searched similar topics here and I found one similar question from 2011 and some other guy in 2020 with the opposite problem: that his CPU was always running in a lower than normal frequency.

Are you guys experiencing similar problems? Note that this might not be noticeable on laptops with proper heat dissipation or desktops.

1 Like

Work fine.

Got one laptop (HP Pavilion g7) that heats also on Ubuntu, freezes if I visit some sites with a lot of adds in there …
Haiku runs fine, but I need to disable some CPU’s in Pulse to have something work-able. (even updating haikuports dependencies ended up in freezes before I disabled some CPU’s).
HW related as it happens on Ubuntu and Haiku here.

Ok so I tried this command and, as suspected, neither intel_pstates nor intel_cstates are loading. Only acpi_battery and acpi_button on /power/. Moreover, Activity Monitor does not show the CPU Frequency like yours. Is there something I can do? BIOS don’t have any configurable ACPI settings.

By the way, I’m running vanilla R3 (not the nightlys). Not sure if there’s something important that changed since then.

Update: tried a nightly ISO with same results

The C-States module requires a number of CPU features, perhaps your CPU does not have them? Same for the P-States module.

1 Like

Could be. It’s a very basic, old CPU anyways. I know it can step down to 1 GHz from the max 1.66 GHz, but I don’t know if it uses some older mechanism on Windows…

This is the info as displayed by sysinfo, by the way:

CPU #0: “Intel(R) Atom™ CPU N450 @ 1.66GHz”
Signature: 0x0106ca; Type 0, family 6, model 28, stepping 10
Features: 0xbfe9fbff
FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT
CFLUSH DS ACPI MMX FXSTR SSE SSE2 SS HTT TM PBE
Extended Features (0x00000001): 0x0040e39d
SSE3 DTES64 MONITOR DS-CPL EST TM2 SSSE3 CX16 xTPR PDCM MOVEB
Extended Features (0x80000001): 0x20100800
SCE NX 64

L2 Data cache fully associative, 1 lines/tag, 64 bytes/line
L2 cache: 512 KB, 8-way set associative, 0 lines/tag, 64 bytes/line

L0 Data TLB: 4K-bytes pages, fully associative, 16 entries
Data TLB, 4K-bytes pages, 4-way set associative, 64 entries
Inst TLB, 4K-bytes pages, 32 entries
Data TLB, 4K-4M bytes pages, 4-way set associative, 8 entries
L1 cache: 16 KB, 4-way set associative, 16 bytes/line
L1 inst cache: 32 KB, 8-way set associative, 64 bytes/line
L1 data cache, 24 KB, 6-way set associative, 64-bytes/line

Check your bios and see if it supports auto clock adjustment, many do

1 Like

Yeah, I did. Problem is, these BIOS are fairly locked down and won’t let you touch anything other that the boot sequence and some basic options. I see some modded bios on the Internet but I don’t know if I should trust that haha.

No, but seriously, I see cpu frequency stepping works for a number of CPUs, so might be an issue with this particular model, or it’s combination with this bios.

In any case, if you think it’s interesting enough, I can provide more info from my system if requested.

The CPU is probably all that’s needed. Model 28 is certainly not in the list of supported models in the driver. Someone would have to go through the Intel specs and see if it has hardware p-states (that should work out of the box and maybe the BIOS has it disabled if that’s possible) or the other performance control method and then it should be added to the list.

3 Likes

Hi, thank you for your reply. I just booted Linux to see what happens and, same as Haiku, the kernel says pstates on this CPU is not supported. However, since I know this CPU can change frequency, I did some more reserach and found the following:

Apparently, this CPU can run at three speeds in Linux: 1000, 1300 and 1666 MHz, but it is not managed with the intel_pstate feature on kernel, rather with the acpi-cpufreq driver and cpufreqd daemon. I think… I remember these first CPUs with dynamic frequencies relied on drivers on Windows and such.

Anyways, many thank you for your replies and interest. I see this is a good community. Hope this topic serve as a guide for other being confused about the same issue.

I’ll leave you the info I found for making it work in Linux, just in case a developer is interested:

https://bbs.archlinux.org/viewtopic.php?pid=782603

UPDATE: I found more info. The specific technology of these CPUs is called SpeedStep 1/2 and is used on all mobile Pentium III, Pentium 4 and most Intel Atoms, because most of them are based on Pentium III. Linux make it work through acpi-cpufreq with automatic scaling based on the kernel scheduling, and more specifically, looks like it’s using the speedstep-lib library found here:

In the same level as this library you can found so many specific libraries for a lot of CPUs that don’t use the pstates of current gen CPUs.

6 Likes

I was going to reply that it probably needs special drivers. These are a bit complicated to support as clock relies on the frequency on older cpu’s. Also not sure any developer has that kind of machine. So it probably needs someone interested enough to add drivers for that…

1 Like

Yeah, what I’m thinking is that, aside of the driver, it would also need to implement a mechanism similar to cpufreqd where a daemon monitors kernel load and trigger frequency changes for a variety of older CPUs. It would benefit… all CPUs prior the age of Core 2 or so: Pentium 3/4, Atoms, K8s and Athlons. I understand, though, there are far more important priorities to be cared of than this.

Well, at least we know it is feasible, since Linux implemented it. Now I need to investigate if some BSD flavor also made it to work and how.

2 Likes

Not really, in our case this functionality is done directly on the kernel side. The kernel already monitors itself and there is no reason to move any of this to userspace. The intel_ctate and intel_pstate drivers already plug into this directly in the kernel, and the new driver could do the same.

As tqh mentionned, the main problem on these machines is, if you change the CPU frequency, it also changes several other clocks and timers, so everything runs at the wrong speed. For example, the clock on Deskbar will run slower than real time, and we need to compensate for that in some way. That would require a lot of small changes in various parts of the system where we deal with timings.

4 Likes

We actually have an x86_cpuidle driver which uses ACPI but doesn’t seem to be built by default (does it even build anymore, actually?)

2 Likes

I have a Pentium M laptop, so to me this would be interesting

1 Like

i feel like a dick everytime i say this kinda thing, upgrade your laptop, it’s gotta be 12+ yrs pld by now

1 Like

As I said, it’s not a priority. But feels good to use an old laptopt that everyone consider useless and make it fast and smooth as a Haiku machine. These Atom laptops are selling on ebay for 50 € for a reason, but they work specially well on Haiku, and they are much smaller than modern laptops.

6 Likes

Yes, you were wrong the last time you said it and you are wrong now. I will continue to ignore your “suggestion”

8 Likes

This is where you mentally go off the rails, this isn’t a matter of wrong or right. This is a matter of capable developer resources to cater to a very small fractional problem. There are newer laptops with better battery life, thermals etc that are very affordable.

someone being less financially capable, isn’t everyone else’s problem. It’s a 12 yr old laptop who’s life span is over. they have a 3-5 yr designed lifespan.

1 Like

Planned obsolescence is a problem that lightweight operating systems can help solve. We aren’t Windows or Mac. My Mac Mini had a useful life of 2 years (it was deemed incompatible with anything newer than 10.7 Lion) and I installed Linux on it and easily got another 5 years out of it before I finally got sick of the Core2 Duo. That said, I don’t expect Linux to run on my 1992 vintage Commodore Amiga 1200 due to the lack of an accelerator card and RAM. Maybe the BeBox shouldn’t be expected to run Haiku either. It’s about 25 years old now also. Use different horses for different courses and all that.

3 Likes