powerd - Add temperature-based management
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 7 Sep 2016 18:41:25 +0000 (11:41 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 12 Sep 2016 01:09:59 +0000 (18:09 -0700)
commit32c04bc58ebf5ffdfaa783fe82ea8873d0cb7576
treecb3adaf8c7bf008a9fd91595488d450d3f34930c
parentdf78d2169d3d0841b92d907489b01965bf4015f0
powerd - Add temperature-based management

* Add temperature-based management, with a default range of 75:85 (in C).
  If the cpu temperature exceeds the low range, powerd will enter
  temperature control mode and begin ramping-down the cpu frequency
  regardless of the load in order to prevent the laptop from reaching
  the high range.

* Add -H lowtemp:hightemp option to allow the range to be set when
  starting or restarting powerd.

* Add code to automatically kill a previously-running powerd when a new
  powerd is started.  This makes the system operator's life easier as there
  is no need to hunt-down and kill the previously-running powerd when
  restarting it with new options.

* No desktop or server should ever get to 75C unless your cooling is broken,
  so this feature is primarily targetted at laptops.  Many laptops can exceed
  80C due to bad cooling design (and poor-design in general), and a vendor
  propensity to goose the specs to make their laptops look good on paper.
  Even the BIOS HOT cap tends to actually be too hot for continuous use.

  But it just isn't a good idea to exceed 80C regardless of what the specs
  say.  The laptop will last a lot longer and this reduces your chances of
  having melt-down or fire.  People who run BSD or Linux systems on laptops
  often do bulk compiles on them and/or other things, such as multiple
  browser windows, tabs, a lot of multi-media, multiple video windows,
  multiple video outputs, etc, which can utilize all available resources
  on the laptop.  Vendors usually don't take all of this into account.
  This feature can allow all of this to happen without burning the laptop
  up.

  You can also use this feature if your laptop gets too hot when sitting on
  your lap :-).

Tested-by: Multiple people.
usr.sbin/powerd/powerd.8
usr.sbin/powerd/powerd.c