The Linux Thermal Daemon program from 01.org

Thermald deals with thermal issues for intel processor families 
codenamed intel sandy-bridge and above.  It is a Linux daemon 
used to prevent the overheating of systems.  This daemon monitors 
temperature and applies compensation using available cooling methods.

Prerequisites: intel p-state driver and kernel 3.10+

Prefers kernel with:
  Intel RAPL power capping driver : Available from Linux kernel 3.13.rc1
  Intel P State driver (Available in Linux kernel stable release)
  Intel Power clamp driver (Available in Linux kernel stable release)

  CONFIG_X86_MSR, so that x86 MSR can be read/write from user space
  to control RAPL if no RAPL powecap class driver is not present.

  If none of the above is available uses cpufreq to control P states.
