An intel i5-8400 processor has 6 cores. On both FreeBSD 11.2 and 12.0-RELEASE frequency scaling via both powerd or explicit sysctl is broken unless all but one core is disabled via BIOS. # sysctl dev.cpu.0.freq_levels dev.cpu.0.freq_levels: 2801/65000 2800/65000 2700/61690 2500/55888 2400/52759 2200/47301 2100/44946 1900/39204 1800/37000 1700/34277 1500/29546 1400/27531 1200/22557 1100/20688 900/16549 800/14296 # sysctl dev.cpu.0.freq=2800 dev.cpu.0.freq: 800 -> 800 It appears cf_set_method() returns EPERM at sys/kern_cpu.c:287 and commenting out that conditional restores frequency scaling when multiple cores are enabled. Whilst this ugly local patch suffices its obviously not correct and I'm not sure how to proceed from here.
If you set debug.acpi.disabled="thermal" in loader.conf and reboot, does powerd / sysctl work? It seems any kernel setting overrides and userspace space setting. A related question, what are the temperature sensors reporting? Is your CPU cooled appropriately / might it be reasonable that thermal throttling is kicking in?
This code hasn't changed substantially in a long time, so I suspect this is not some recent regression.
It could be that this is related to my observation: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234733
Still present in 12.1-RELEASE-p1
@Dave, did you try debug.acpi.disabled="thermal"? It seems bizarre that the default dev.cpu.0.freq is 800. Is that the case at boot, or was your initial description after running, say, powerd? It might be that Coffeelake does not really support est and needs Intel Speed Shift instead. That is not yet in tree but there is a work-in-progress patch: https://reviews.freebsd.org/D18028 @Erich, I suspect these are unrelated issues in that a different cpufreq driver is used on Zen (hwpstate) and Intel (est). But maybe there is some relation. I do not recommend powerd and would suggest disabling it. In fact, we should probably remove it from FreeBSD. It is extremely legacy and only really works correctly on ancient single core devices. I also don't recommend manual p-state setting via sysctl. Modern CPUs do a fantastic job of power saving with C states alone — P-state throttling doesn't get you much anymore.
CPU is 800 at boot either with or without powerd. Temperature is always stable at 25 degrees. I'll retry debug.acpi.disabled="thermal" but I don't recall it having any effect for 11.2-RELEASE. If I comment out the conditional in cf_set_method() at kern/kern_cpu.c:291 then both sysctl and powerd can be used to adjust the frequency. > if (priority < sc->curr_priority) { > CF_DEBUG("ignoring, curr prio %d less than %d\n", priority, > sc->curr_priority); > error = EPERM; > goto out; > }
I wonder where those bogus priorities are coming from, though. I thought I recall looking and seeing acpi_thermal as the only possible source, but I might be mistaken.
Also: 800 at boot sounds like a BIOS bug.
FWIW, debug.acpi.disabled="thermal" on my 12.1-p1 system on a AMD Ryzen seems to have solved the issue I had with the CPU staying at the lowest frequency even when building world.
Fixed in 13.0-RELEASE