Live data from Hacker News

What should the CPU usage be of a fully-loaded CPU that has been throttled?

devblogs.microsoft.com

11–20 of 181 posts

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#11
A key problem with this proposal is that modern CPUs do not have a single definitive maximum frequency. You have the base frequency which is rarely relevant outside of synthetic workloads then you have a variety of turbo frequencies which interact in complex ways. AMD's latest CPUs don't even have clear upper bounds on their frequency scaling logic. It's a big black box and the results can vary depending on the workload, temperature, silicon quality, phase of moon, etc.

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#12
post #5

I think Apple's approach of attributing the capacity not available due to throttling (or various other reasons) to kernel_task might be the best. You can tell something is eating cpu, stuff isn't just stuck at 50% while the rest of the system looks idle. Although then you have users trying to figure out how to kill kernel_task, which isn't great either...

Users trying to kill kernel_task sounds like an uncaught design problem. Replace the kill options in context drop-downs with "Why can't I kill kernel_task?" and have it pop open a short explanation, do the same as a feedback message if anyone tries to kill in the terminal.

If the system doesn't do that already, either nobody considered that users would try that particular nonsensical thing, or nobody cared enough to let users find out immediately instead of wasting their time thinking the computer was at fault.

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#14
post #7

Related, 50% CPU usage on a hyper-threaded CPU isn't 50%. It is usually closer to 80-90% depending on the workload. Something to watch out for when monitoring.

Interesting. Does this mean that if you are not going to use all HT threads it's better to turn off HT?

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#16
I think we can have more nuance than a choice of 50% or 100%. I fall in the 'Show 100%' camp for sure, showing 50% but not indicating why isn't particularly helpful without knowing the background here. I think a separate indicator for an overall throttling condition would be helpful. Show a 100% usage and a throttle indicator together.

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#18
post #11

A key problem with this proposal is that modern CPUs do not have a single definitive maximum frequency. You have the base frequency which is rarely relevant outside of synthetic workloads then you have a variety of turbo frequencies which interact in complex ways. AMD's latest CPUs don't even have clear upper bounds on their frequency scaling logic. It's a big black box and the results can vary depending on the workl…

The OS can keep a record over time of the maximum frequency each CPU core has ever hit.

This will take into account machine to machine variance, and even environmental factors effecting maximum speed.

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#19
Power saving and "throttling" (usually it's un-turboing) are different cases that shouldn't be conflated; in one case the processor could run faster but in the other it can't. Ultimately we may want different metrics depending on what they're going to be used for. If you calculate relative to base frequency you will get utilization over 100% which is going to confuse some people.

Linux has done some work in this area with frequency-invariant utilization tracking: https://lwn.net/Articles/816388/

Re: What should the CPU usage be of a fully-loaded CPU that has been throttled?

#20
post #14
post #7

Related, 50% CPU usage on a hyper-threaded CPU isn't 50%. It is usually closer to 80-90% depending on the workload. Something to watch out for when monitoring.

Interesting. Does this mean that if you are not going to use all HT threads it's better to turn off HT?

No, don't turn it off. One thread on a core will go full speed, and two threads on a core will do more work than one thread. It's just that your utilization graph will be misleading. A naive graph will assume that two threads do twice as much work as one, but the real improvement is much smaller.

If you turn off hyperthreading and keep the same exact workload, then instead of "the graph says 50% but it's really more like 80-90%", you'll have "the graph says 100% and it's correct". The numbers now accurately represent your lower capacity.

Post reply on HN