Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2017 14:15:13 -0500
From:      Karl Denninger <karl@denninger.net>
To:        freebsd-stable@freebsd.org
Subject:   Re: issues with powerd/freq_levels
Message-ID:  <7c484581-32d9-ff59-2fc9-f1dd555c0eb7@denninger.net>
In-Reply-To: <CAN6yY1t5xYXMig0PSGn=Gdr=fOZJUBUYEGtXYxxJ9Q7R=z_kWw@mail.gmail.com>
References:  <8AEC9DBC-BADD-4FB2-8358-DA43F7EF5E68@cs.huji.ac.il> <20170731201323.A6737@sola.nimnet.asn.au> <CAN6yY1t5xYXMig0PSGn=Gdr=fOZJUBUYEGtXYxxJ9Q7R=z_kWw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 7/31/2017 14:03, Kevin Oberman wrote:
> On Mon, Jul 31, 2017 at 3:48 AM, Ian Smith <smithi@nimnet.asn.au> wrote:
>
>> On Mon, 31 Jul 2017 10:09:11 +0300, Daniel Braniss wrote:
>>
>>  > I am trying out PCengines latest apu2 boards, and I just noticed that
>> with different Freebsd versions I get
>>  > different freq_levels, and so when idling, each box (have 5) has a
>> different freq/temperature value, ranging
>>  > from 125/69.1C, 600/59.0C to 75/56.0C
>>  >
>>  > FreeBSD apu-4 11.1-STABLE FreeBSD 11.1-STABLE #5 f565b5a06ab3 (11) tip:
>> Mon Jul 31 09:36:33 IDT 2017
>>  > apu-4# sysctl dev.cpu.0.freq_levels
>>  > dev.cpu.0.freq_levels: 1000/980 800/807 600/609
>>
>> That looks about right.  On a Core2Duo (still on 9.3) I get:
>> dev.est.1.freq_settings: 2401/35000 2400/35000 1600/15000 800/12000
>> dev.est.0.freq_settings: 2401/35000 2400/35000 1600/15000 800/12000
>> dev.cpu.0.freq_levels: 2401/35000 2400/35000 1600/15000 800/12000
>> dev.cpu.0.freq: 800
>>
>> But only because I'd added to /boot/loader.conf:
>>
>> hint.p4tcc.0.disabled=1
>> hint.acpi_throttle.0.disabled=1
>>
>> which became the defaults sometime, maybe not before 11.0?  Otherwise
>> mine would look more similar to the one below, with all 12.5% increments
>> in frequency enabled, which doesn't actually save any power at all.
>>
>>  > FreeBSD apu-5 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE #0 21e9d1ca9b80
>> (11) tip: Tue May 30 11:51:48 IDT 2017
>>  > apu-5# sysctl dev.cpu.0.freq_levels
>>  > dev.cpu.0.freq_levels: 1000/966 875/845 800/795 700/695 600/600 525/525
>> 450/450 375/375 300/300 225/225 150/150 75/75
>>
>> Looks like either p4tcc or acpi_throttle is enabled?  See cpufreq(4).
>> As above, these don't buy you anything but extra busyness for powerd.
>>
>> Also noticed that the (nice, low!) milliwatt figures for 1000/800/600
>> freqs are a bit different to the -stable one.  Slightly Different model?
>>
>>  > FreeBSD apu-1 10.3-STABLE FreeBSD 10.3-STABLE #4 267788fd852c (10) tip:
>> Tue Jan 10 09:09:00 IST 2017
>>  > apu-1# sysctl dev.cpu.0.freq_levels
>>  > dev.cpu.0.freq_levels: 1000/-1 875/-1 750/-1 625/-1 500/-1 375/-1
>> 250/-1 125/-1
>>
>> And that looks like est(4) isn't enabled/attaching at all .. see dmesg
>> on all of these for clues.
>>
>>  > so, any ideas as to what is going on?
>>
>> Pure guesswork on experience with older versions, I'm not up to date.
>>
> Very odd. Are all systems running identical CPUs and BIOSes? Identical
> loader and sysctl configurations? Look at /var/rn/dmesg.boot for CPU
> information. Is EST being detected? It used to be early in the boot
> process, but is now fairly late. (In my case, about 2/3 through the
> dmesg.boot file.
>
> I have p4tcc and throttling explicitly turned off (which should now be the
> default), but my Sandy Bridge Core i5 still shows:
> dev.cpu.0.freq_levels: 2501/35000 2500/35000 2000/26426 1800/23233
> 1600/20164 1400/17226 1200/14408 1000/11713 800/9140
> The first is really bogus to indicate "turbo" mode.
>
> Temperature is a totally separate issue. It is VERY sensitive to external
> issue like airflow and position of the CPU in relation to other components
> in the chassis Also, unless you have a lot of cores, you probably should
> set both economy_cx_lowest and performance_cx_lowest to Cmax. Economy
> should default to that, but  performance will not as that can cause issues
> on systems with large numbers of cores, so is set to C2. Many such system
> used to disable deeper sleep modes in BIOS, but I am way behind the times
> and don't know about the current state of affairs. Certainly for systems
> with 32 or fewer cores, this should not be an issue. In any case, Cx state
> can sharply impact temperature.
>
> Finally, the last case with power levels of -1 for all frequencies is
> probably because the CPU manufacturer (Intel?) has not published this
> information. For a while they were treating this as "proprietary"
> information. Very annoying! It's always something that is not readily
> available. Thi is one reason I suspect your CPUs are not identical.
> --
> Kevin Oberman, Part time kid herder and retired Network Engineer
> E-mail: rkoberman@gmail.com
> PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
> _______________________________________________
> freebsd-stable@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"

I have a very new PCEngines unit here running 11.0-STABLE and this is
what I have in the related sysctls:

$ sysctl -a|grep cpu.0
dev.cpu.0.cx_method: C1/hlt C2/io
dev.cpu.0.cx_usage_counters: 2261969965 3038
dev.cpu.0.cx_usage: 99.99% 0.00% last 798us
dev.cpu.0.cx_lowest: C2
dev.cpu.0.cx_supported: C1/1/0 C2/2/400
dev.cpu.0.freq_levels: 1000/924 800/760 600/571
dev.cpu.0.freq: 1000
dev.cpu.0.temperature: 59.2C
dev.cpu.0.%parent: acpi0
dev.cpu.0.%pnpinfo: _HID=none _UID=0
dev.cpu.0.%location: handle=\_PR_.P000
dev.cpu.0.%driver: cpu
dev.cpu.0.%desc: ACPI CPU

....

$ sysctl -a|grep cx
hw.acpi.cpu.cx_lowest: C2
dev.cpu.3.cx_method: C1/hlt
dev.cpu.3.cx_usage_counters: 111298364
dev.cpu.3.cx_usage: 100.00% last 30us
dev.cpu.3.cx_lowest: C2
dev.cpu.3.cx_supported: C1/1/0
dev.cpu.2.cx_method: C1/hlt
dev.cpu.2.cx_usage_counters: 127978480
dev.cpu.2.cx_usage: 100.00% last 35us
dev.cpu.2.cx_lowest: C2
dev.cpu.2.cx_supported: C1/1/0
dev.cpu.1.cx_method: C1/hlt
dev.cpu.1.cx_usage_counters: 108161434
dev.cpu.1.cx_usage: 100.00% last 29us
dev.cpu.1.cx_lowest: C2
dev.cpu.1.cx_supported: C1/1/0
dev.cpu.0.cx_method: C1/hlt C2/io
dev.cpu.0.cx_usage_counters: 2261916773 3038
dev.cpu.0.cx_usage: 99.99% 0.00% last 378us
dev.cpu.0.cx_lowest: C2
dev.cpu.0.cx_supported: C1/1/0 C2/2/400


These are fanless, 4-core devices that are pretty cool -- they've got
AES instructions in them and thus make very nice VPN gateways running
something like Strongswan, and come with either 2 or 3 gigabit
interfaces on the board.   Oh, and they run on 12V.

Powerd is logging this, however...

hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6

Hmmmm....

-- 
Karl Denninger
karl@denninger.net <mailto:karl@denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/

[-- Attachment #2 --]
0	*H
010
	`He0	*H
\0X0@=0
	*H
010	UUS10UFlorida10U	Niceville10U
Cuda Systems LLC10UCuda Systems LLC CA1"0 	*H
	Cuda Systems LLC CA0
161218194535Z
211217194535Z0W10	UUS10UFlorida10U
Cuda Systems LLC10Ukarl@denninger.net0"0
	*H
0
͍fd`1ie6";fSz`5¹/?{=Ӵowjħ_fnӴMG\ҢҖ4ib}>@mJo&mM;
Q9U cj]p퐆W.2E=
^¢tzĄ'5i7_`~#dY
`]R]N%R}EXzqV@[oN	T>5AwYˡA"\v&YG]+($p:M,T?=mJkMљg*ym
L!J[./d׷?W^LysD'1
+V'~{-SSX=q-f=%&V<m4BeSet|
l2m 6iO{wv
+aHXˈ5=~é*C!?uJr3tb'3`Oe)üLxt&3N526llU
.|Cp[l?007++0)0'+0http://cudasystems.net:88880	U00	`HB0U0,	`HB
OpenSSL Generated Certificate0U/Zi
0GhG0U#0$q}ݽʒm50U0karl@denninger.net0
	*H
b%X%gwq	
ɁэrK[DMJ35W6
sz8d|qB2Cyw2PbV}
â[!W{HD7oD.TZ'w6~g( -,]R8P{*[f<1=7jGj9铚~3f2AʺN	k~@vz^j(>ͺyh2y{/9}4.45#S|<fW!.,Bss*Q+h=}l@	"q "M&6J5*,G {hɫjbNgǠ.ЃXȶ4$O.5evHlZba!4eE!x|Za1򹿈nZ5TuPvW|#G+	DZpI7S'n0 haGa@vZ	e|]Cu+))vRyY100010	UUS10UFlorida10U	Niceville10U
Cuda Systems LLC10UCuda Systems LLC CA1"0 	*H
	Cuda Systems LLC CA=0
	`HeM0	*H
	1	*H
0	*H
	1
170731191513Z0O	*H
	1B@5#N]Cgu"6YxSUYX5Țɿ`͸x5^b
"k60l	*H
	1_0]0	`He*0	`He0
*H
0*H
0
*H
@0+0
*H
(0	+710010	UUS10UFlorida10U	Niceville10U
Cuda Systems LLC10UCuda Systems LLC CA1"0 	*H
	Cuda Systems LLC CA=0*H
	1010	UUS10UFlorida10U	Niceville10U
Cuda Systems LLC10UCuda Systems LLC CA1"0 	*H
	Cuda Systems LLC CA=0
	*H
m7s:kgt:xB&\D\	N{NN:+8sS[xPIbLំUOF6}NljIG6q(*
 |$U o"!TՀ>\s7óf!b+k$14O|ML^Jj+άFƕw	LB|E[u>T|+b-t=wZVR:GKkvn^bwYUBůX@q;!=Bj,:7c꛻luuϵiXA6k"z{¶!q
a})ZiO.׶+#ţBl/\[MNl@IěV
dVyR=#=H`-w{5߿qeGjHKhF8:己d 6\L-0vȫ6)"X?JS

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7c484581-32d9-ff59-2fc9-f1dd555c0eb7>