Is there some performance counter or similar available which can help quantify the extent to which two hyperthreads on the same core are competing with each other for execution resources?
Use case: in a shared infrastructure environment like Kubernetes, I may be able to request that my process has "1 CPU" of capacity. However with hyperthreading in play this is not a physical core but a logical CPU, and the throughput of that core may vary by as much as a factor of 2 depending on what's scheduled to run on the other logical CPU corresponding to the other hyperthread of the same physical core. Is there some metric which can quantify how much time has been spent stalled waiting on the other hyperthread?
Another use case: depending on the nature of the workload and how much it stands to gain from hyperthreading, average CPU utilization may not be a good indication of available capacity. For a workload that gets no benefit from hyperthreading at all, loading the host beyond 50% CPU utilization may not increase throughput at all. What metrics could I use to determine how much real execution resource, and not just idle logical CPU time, is available?