Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 May 2014 00:52:30 -0400
From:      Allan Jude <freebsd@allanjude.com>
To:        freebsd-current@freebsd.org
Subject:   Re: Leaving the Desktop Market
Message-ID:  <5365C78E.6030600@allanjude.com>
In-Reply-To: <CAJ-Vmo=zXyuyARapz4UCaTwMtWtW_8ys0pgssHOOUhnA-5Bt4g@mail.gmail.com>
References:  <CAF6rxgkeBozvfV-L0%2BrFZ6fWRn0=Gi3BNq1kPL=-HTq0TD6MkQ@mail.gmail.com> <A70900DF-4BAA-427F-8731-01211FFD1887@mail.turbofuzz.com> <3F7430D7-3C0F-43E1-8EBD-8AA4F701497C@FreeBSD.org> <20140503155745.GA2457@La-Habana> <CAJ-VmokHQvb2S-1c08J3RECUMosQ%2Bcd1gdB91LAb5famfKqP5w@mail.gmail.com> <20140503192305.GA1847@La-Habana> <CAJ-Vmon1ZYX18SN1f=z9N=hSgpZrAxXMxiJBUDWk6LYvMRiHmw@mail.gmail.com> <CAN6yY1uo08PDsYJ2KQNjw4hYuNsNJUvRu1b0cG%2B387F6Owkukg@mail.gmail.com> <536592D1.7080403@freebsd.org> <CAN6yY1tdsitXmGeu87OBw6RZ_s0qDvuoYXbTJVjnr74k6oM4Ag@mail.gmail.com> <CAJ-Vmo=zXyuyARapz4UCaTwMtWtW_8ys0pgssHOOUhnA-5Bt4g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--IaanAR2Lf267ER2ddT3ELAPgXc3ur33If
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 2014-05-04 00:49, Adrian Chadd wrote:
> Hi,
>=20
> Well, hardware got better. A lot better. I'm happy to leave speedstep
> and throttling in there but teach powerd about using C-states and
> limited frequency stepping if it's available.
>=20
> So, how about something like this:
>=20
> * if C states are available - let's just use C states and not step the
> cpu frequency at all;
> * if turboboost is available - enable that, and disable it if we
> notice the CPU runs at the higher frequency for too long;

If I recall correctly, the BIOS has settings that control and limit how
long the CPU will run in 'turbo boost' mode

> * use cpufreq with some heuristics (like say, only step down to 2/3rd
> the frequency if idle) - and document why that decision is made (eg on
> CPU X, measuring Y at idle, power consumption was minimal at
> frequency=3DZ.);
> * make sure the lower frequencies and tcc kick in if a thermal cutoff
> is reached;
> * default to using lower Cx states out of the box if they're decided
> to not be buggy. There are a few CPUs for which lower C states cause
> problems but modernish hardware (say, nehalem and later) should be
> fine.

According to the wiki, in 9.x and onward there is code that is supposed
to detect if the higher Cx states are usable, and not use them if they
are not, but I do not know how well this works.

>=20
> That's vaguely what I've been tossing around in my head.
>=20
>=20
>=20
> -a
>=20
>=20
> On 3 May 2014 21:16, Kevin Oberman <rkoberman@gmail.com> wrote:
>> On Sat, May 3, 2014 at 6:07 PM, Nathan Whitehorn <nwhitehorn@freebsd.o=
rg>
>> wrote:
>>>
>>> On 05/03/14 16:59, Kevin Oberman wrote:
>>>>
>>>> On Sat, May 3, 2014 at 1:25 PM, Adrian Chadd <adrian@freebsd.org> wr=
ote:
>>>>
>>>>> Set it to the lowest available Cx state that you see in dev.cpu.0 .=

>>>>>
>>>>>
>>>> Available is not required. Set it to C8. That guarantees that you wi=
ll
>>>> use
>>>> the lowest available. The correct incantation in rc.conf is "Cmax".
>>>> performance_cx_lowest=3D"Cmax"
>>>> economy_cx_lowest=3D"Cmax"
>>>>
>>>> But, unless you want laggy performance, you will probably also want:=

>>>> hint.p4tcc.0.disabled=3D1
>>>> hint.acpi_throttle.0.disabled=3D1
>>>> in /boot/loader.conf. Low Cx states and TCC/throttling simply don't =
mix
>>>> well and TCC is not effective, as mentioned earlier in this thread.
>>>
>>>
>>> Is there any reason that TCC is on by default, actually? It seems lik=
e an
>>> anti-feature.
>>
>>
>> I've been baffled by this for years. Throttling was first. SpeedStep w=
as
>> about all that was available for power management and even that was no=
t
>> available for older laptops. It was thought that throttling was a way =
to get
>> some power management for those older systems. Nate was developing the=
 first
>> power management for FreeBSD and the first implementation of SST. He t=
hrew
>> in throttling as both an added capability an something for older lapto=
ps
>> that lacked SpeedStep.
>>
>> It made sense to me, too, After all, SST only provided two performance=

>> levels. It was an improvement from nothing, but not a really a lot and=
,
>> mostly because neither of us thought about it enough, we really believ=
ed
>> throttling was a help. Before cpufreq was committed, the Pentium 4 cam=
e out,
>> including TCC which did what throttling did,but much more cleanly.So c=
pufreq
>> was modified to use TCC if available and throttling when not. In retro=
spect,
>> this was pretty dumb, but it made sense at the time.
>>
>> Soon after that, EST (true P-states) came out. It really reduced power=

>> consumption in normal applications. A driver for it was added fairly
>> quickly, but throttling/TCC remained. Its only real effect was to add
>> several many more "frequencies" to powerd, taking longer to save power=
 when
>> the CPU was lightly loaded and causing lag in speeding up when things =
got
>> busy.
>>
>> Next, along came C-states and, almost simultaneously, D-states. Dx was=
 very
>> closely linked to the hardware and savings were often limited, but C-s=
tates
>> were the real deal. This was a huge change as it really did save power=
=2E
>> Unfortunately people started reporting that Cx states were causing CPU=

>> lockup and very laggy interactive behavior.  As a result, the default
>> setting for Cx states was to disable them. This was a really bad choic=
e. It
>> was made without any analysis of why.Cx was hanging systems and workin=
g
>> badly, so turn it off.
>>
>> It took me very little time to discover the problem.My old laptop at t=
he
>> time this happened as a Pentium-M with a lowest P-state of 800 MHz. As=
s TCC
>> and the idle clock was effectively just 100 MHz. When you combine the =
way
>> powerd adjusted speed and C-states, the best you can hope for is crapp=
y
>> interactivity. It just took way too long to get out of the lowest idle=

>> state. I can't explain the hangs as I never experienced them, but simp=
ly
>> turning off TCC (and throttling) prevented it.
>>
>> It looked like the obvious thing to do was to turn off TCC and make fu=
ll use
>> of C-states. This became even more blindingly obvious when mav put up =
his
>> very excellent paper on power management on FreeBSD.  If you care abou=
t
>> power management and have not read it, do so now!
>> https://wiki.freebsd.org/TuningPowerConsumption
>>
>> Why mav's suggestions were not made default,I simply don't understand.=
 I'm
>> sure much of it is that FreeBSD is developed primarily for servers and=

>> people seem to often not care much about power savings on servers, tho=
ugh
>> this is finally changing.
>>
>> I think I got most of the history correct, though it goes back to v4, =
a lot
>> of years ago. Since I retired, I no longer have access to my old mail,=
 so I
>> may have gotten some details wrong. If so, I apologize.
>> --
>> R. Kevin Oberman, Network Engineer, Retired
>> E-mail: rkoberman@gmail.com
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o=
rg"
>=20


--=20
Allan Jude


--IaanAR2Lf267ER2ddT3ELAPgXc3ur33If
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTZceRAAoJEJrBFpNRJZKfAIkP/1+C1UaForm+hVPs3rK+x7hx
2mU5oFPv1OgKDFA3B8bf6/VX5BbE4WJJG7tYbq22tnK5pxmOCbjjsl9oE3sXLWH6
22IvUui4xX6csqwinDiRVGUShMnhNANByMjg+6+pl5J63cGjahFCYNLyQbhC0slo
yuG4vifrMDdKNBUwQ9gZ/LLY+JE1bXCeH2joncjvk+KRZxp3VpVA7TRq5LTin9Cy
C5IwUneKoIhWLCeoG31LXcqWt+Z+t36kwL/5/2ePJFc/ikT3u797SXO2Pcq3OS7i
0ZWoPNucpEWmCZFVy80d4VIrPyCC3Kub+DTHd+Zno5HXG3iWv7uosK9rnZRAuFbn
LEp7PyDya+DPZqfuhI4QRva/d1f/S+v4O/Vpk84atMi/dFcS6FT9c3C7vWruNbmo
qdCaXbuZNuxtYwa0dpJCelSZ9XLzFCYw7oOg9VVavYLRVmZZlRxCJ/LOVO0m21IL
FR71mgUmI/KM6PC52mZaOdPOUiC8gRYK2iv7CBsRS2LdzqNH04v/ONKb6XU8NhGf
T6DeLVnyJe0Dvvp5dy0o/hzSp7SzG9L+3eC7O/wc2c0cCrNtMAjKbnUVpkaWS8Zn
fF5MPl5s/P/lKcUk1nS8N53OQqntrFZt2JizrzTPqDIExflsw1jc9T6Ad5eBW30n
+kJ9I1NBCUKjMZ5ypwpQ
=24o4
-----END PGP SIGNATURE-----

--IaanAR2Lf267ER2ddT3ELAPgXc3ur33If--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5365C78E.6030600>