3 ms·
Wait, what? From reading the git repos a bit, it seems that Lenovo and Intel have created some framework that is, in its default state, modifying the thermal M
by amluto 8y ago
Wait, what? From reading the git repos a bit, it seems that Lenovo and Intel have created some framework that is, in its default state, modifying the thermal MSRs every five seconds via SMI (presumably).
Let that sink in. Somehow, rather than letting the CPU run with reasonable parameters and letting the EC control fans as needed, they are forcing the system into SMM (which interrupts everything on all cores) to fiddle with thermal parameters. And they want some ridiculous user space library (DPTF) to reconfigure this mess to actually do something sensible.
WTF
edit: Wow, the Intel code in question is hilariously enterprisey. Check this out:
https://github.com/intel/dptf/blob/master/DPTF/Sources/Policies/ActivePolicy/ActivePolicy.cpp https://github.com/intel/dptf/blob/master/DPTF/Sources/Polic...
and that repo is full of files like SuchAndSuchFacadeInterface.h.
I swear that at least 95% of the code doesn’t do anything. Maybe 99%.
- nixpulvis 8y agoI'm not even surprised anymore. Just consistently horrified and considering a new line of work.
- m_mueller 8y agoI’ve looked at this code a bit and.... seems relatively straightforward to me. Am I too much used to enterprise code? Do you just mean the verbose naming?
- amluto 8y agoI mean the sheer amount of abstraction. On a brief inspection, this code essentially does: when temp > upper_threshold: turn fan on until temp < lower_threshold For a vendor-provided set of tuples (temperature, fan, upper_threshold, lower_threshold). And it’s not really clear whether the code is intended to handle the same temperature or fan occurring more than once. This logic could be written in maybe 100 lines of code if all the abstraction were removed, and that’s if full support for repeats is needed. Instead there are layers and layers of abstraction. Also, this code doesn’t belong in a user program or even on the main CPU at all. It belongs in the embedded controller.