ThermalD, the Linux Thermal Daemon can be used to automatically handle CPU frequency scaling according to system load.