Hacker News new | comments | ask | show | jobs | submit login

Page 8: "To fix this bug, we alter the code that is executed when a thread wakes up. We wake up the thread on the local core—i.e., the core where the thread was scheduled last— if it is idle; otherwise, if there are idle cores in the system, we wake up the thread on the core that has been idle for the longest amount of time."

I don't quite understand the choice for picking the core that was idle for the longest time. I think they use that as a predictor of future load of the CPU, and scheduling based on future load see,s a good idea, but I think this could lead to cases where it prevents one of more CPUs to go to low power states when the system doesn't have enough work to keep all its cores fully occupied.

(Edit: how did I overlook the following paragraph, where they discuss this issue?)

Also, in general, I think they too easily call changes that remove the corner cases they find fixes. Chances are that they introduce other corner cases, either on workloads they didn't test or on hardware they didn't test (caveat: I know very little about the variation in hardware that is out there)




The last paragraph of that segment says they pick it because it's the first in the list of idle cores. E.g. if a core is no longer idle it removes itself from the list, and it adds itself at the end, so effectively it's ordered in deminishing idletime time.

Though from my understanding of the patch they walk over all CPUs which is not precisely constant time, and it doesn't seem to be just the list of idle CPUs; for_each_online_cpu(_cpu): https://github.com/jplozi/wastedcores/blob/master/patches/ov...

That said from what I grasp of the code it also doesn't bail out when power management is enabled, so maybe the public code or the paper are not at the same stage of development.


Picking the core that was idle for the longest period may end up working as a proxy for picking the coolest core, and as such encouraging more even distribution of heat and reducing the probability of thermal throttling?


Couldn't it also work to prevent getting cores into deeper sleep states?


Shouldn't every idle core be in low power mode? Doesn't the idle instruction (hlt) tell the cpu to power parts down? I thought it was like a switch, you don't need light? Flip it off, need some? Turn it on at nearly no cost.

There might be newer multistage power down but to wear level and use all cores, this is the right algorithm.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: