Kernel Watch
Jon Masters summarises the latest happenings in the Linux kernel, so that you don’t have to.
Linus Torvalds announced the release of Linux 5.4-rc5, which should have been smaller than it was given that the current development cycle is coming to a close. Still, he wasn’t too concerned about the slight bloat. If things continue to plan, the final release of 5.4 should be featured in our summary next issue.
Is hibernation usable?
Linux has supported hibernation (suspending to disk) for many years. This differs from the typical ‘suspend’ (closing the lid on your laptop) in that the latter relies upon special hardware support maintaining the contents of RAM while effectively shutting down almost everything else. This allows for a very fast suspend, while limiting power draw sufficiently to last a few days.
With hibernation, the machine is actually fully powered-down and can maintain a suspended state almost indefinitely. But a hibernation to disk typically takes much longer than a simple suspend. And it turns out that there are some little-documented issues with hibernation.
These issues include a restriction on the system being able to use more than half of available RAM during the process – the other half is used to store the image being prepared to be written to system swap space. As a result, the current hibernate logic will free up memory in the process, dropping cached state and other unnecessary memory use. It mostly works, but as Luigi Semenzato noted, it may not always. These and other limitations caused him to ask aloud whether hibernation is useful, and whether it needs to be fixed.
Thermal pressure
Thara Gopinath posted a patch series titled Introduce Thermal Pressure, which aims to teach the kernel’s scheduler about the impact of thermals upon maximum CPU frequency.
The kernel currently understands that processors implement DVFS (Dynamic Voltage and Frequency Scaling), in which the operating frequency of cores on the same die (chip) are adjusted continually in accordance with the load. If a machine is not too busy, there are ‘governor’ algorithms that automatically throttle down the speed to save power.
Until now, the kernel did not understand that there is another interaction between frequency and temperature. Under sufficient thermal ‘pressure’, the processor may automatically throttle back the maximum operating frequency in order to avoid damage to the hardware, or because the cooling solution is not sufficient to maintain normal operation – in a phone, for example. The new patches aim to teach the scheduler how to incorporate thermals too.