Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2015 14:43:34 +0200
From:      Stefan Esser <se@freebsd.org>
To:        Jukka Ukkonen <jau789@gmail.com>
Cc:        FreeBSD AMD64 <freebsd-amd64@freebsd.org>
Subject:   Re: Something odd with CPU frequency levels on AMD EE processors
Message-ID:  <55EED7F6.4060602@freebsd.org>
In-Reply-To: <55EE7928.1000804@gmail.com>
References:  <55EE7928.1000804@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 08.09.2015 um 07:59 schrieb Jukka Ukkonen:
> 
> Hello all,
> 
> Previously my AMD EE CPUs have been reporting frequency levels all
> the way down to 100 MHz and powerd also used those quite nicely.
> Yesterday I noticed the fans running at much higher speed than what
> has been normal on a mostly idle system. Now "sysctl dev.cpu.0"
> shows me this...
> 
> dev.cpu.0.cx_usage: 100.00% last 622us
> dev.cpu.0.cx_lowest: C8
> dev.cpu.0.cx_supported: C1/1/0
> dev.cpu.0.freq_levels: 1700/3870 1500/3461 1300/3105 1100/2720 800/2193
> dev.cpu.0.freq: 800
> dev.cpu.0.temperature: 34.6C
> dev.cpu.0.%parent: acpi0
> dev.cpu.0.%pnpinfo: _HID=none _UID=0
> dev.cpu.0.%location: handle=\_PR_.P001
> dev.cpu.0.%driver: cpu
> dev.cpu.0.%desc: ACPI CPU
> 
> The system no longer sees the lower CPU frequency levels at all.
> Obviously it will not try using them either.

Power savings result from lower processor core voltage requirements at
lower clock rates (power goes up qudratic with voltage). The numbers
behind the slash are nominal power requirements (at 100% CPU) when a
certain frequency and corresponding voltage are effective. (E.g.
nominal 3,87W at 1700 MHz, 2,193W at 800 MHz for your processor.)

The other frequencies that you observed were not clock rates, but
effective clocks after injection of "wait cycles" (e.g. 1 one in 8
clocks used to perform any computation, but the clock frequency is
still 800 MHz). This throttling had been introduced in the Pentium-4
with its high power consumption to limit absolute power dissipation
(to prevent damage to the CPU die). But performance is much more
reduced than power consumption, since the CPU voltage is not
reduced during throttling.

The result is, that the CPU consumes nearly the same power as if
it was not throttling, but takes up to 8 times as long to perform
computations (before it can fall into a power saving deep sleep)
and it needs more electrical energy to deal with a given workload.

Throttling tends to increase power consumption and caused numerous
problems including system freezes. It has been disabled by default,
since the problem of the overheating P4 has seen much better
solutions over the last decade.

> This change must have been quite recent. Otherwise I would have
> noticed the fans running at unusually high speeds much earlier
> than yesterday evening. In any case now the idle system consumes
> much more power than it really needs to producing only heat which
> is exactly what I had tried to avoid when choosing the EE CPUs.

What is your low power CPU sleep state? Since CPUs shut down most
circuitry when unused for even a fraction of a millisecond, these
sleeps are the best way to reduce power consumption and dissipation.

> Here is the output from "uname -a" showing the OS version, the SVN
> version number, and the time of the latest build.
> 
> FreeBSD sleipnir 10.2-STABLE FreeBSD 10.2-STABLE #0 r287529: Mon Sep  7
> 09:39:36 EEST 2015     root@sleipnir:/usr/obj/usr/src-10.2/sys/Sleipnir
>  amd64
> 
> I hope someone has an idea what has happened. I would really like
> to enable the lower frequency levels again as soon as possible.

Well, you can by just enabling throttling again, by adding the
following two lines to /boot/loader.conf:

hint.p4tcc.0.disabled="0"
hint.acpi_throttle.0.disabled="0"

But you really should check your power save settings. E:g. on my
i7/2600:

dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc
dev.cpu.0.cx_usage_counters: 2249176 229399 26095890
dev.cpu.0.cx_usage: 7.87% 0.80% 91.32% last 26975us
dev.cpu.0.cx_lowest: C8
dev.cpu.0.cx_supported: C1/1/1 C2/2/80 C3/3/104

My system supports C3 as the deepest power state and it seems to
use it quite often (91%).

What's your setting of performance_cx_lowest and economy_cx_lowest?

I have the following in my rc.conf:

performance_cx_lowest="Cmax"    # Online CPU idle state
economy_cx_lowest="Cmax"        # Offline CPU idle state

And what about powerd:

powerd_enable="YES"
powerd_flags="-r 75 -i 95"
powerd_flags="-a hiadaptive -n hiadaptive"

But powerd may also be of no use for your system - some modern
CPUs are more efficient when always run at the highest possible
clock rate (to complete the given task as quickly as possible
and then be able to fall into a deep sleep state). E.g. the new
Intel Core i7/6xxx CPUs will even boost the clock of a core to
increase the sleep time (instead of lowering the clock to be
able to reduce the CPU voltage).

Regards, STefan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55EED7F6.4060602>