Exploring the link between C-states and latency
Posted: 20 Aug 2024, 10:09
Hello there!
I am here to share the findings from which I have curiously tinkered to find out the reason for this abnormal feeling of inconsistency with inputs, as well as the overall feel of the system. This phenomenon is not limited to one PC, but any PC that has C-states or Dynamic Tick feature enabled.
The phenomenon is the drift or delay in mouse movements which can be noticeable easily when moving the mouse in O-shape or X-shape. I am not sure if the term “Delay” is appropriate to use because it feels more like a drift in movements. Is it only with the mouse that this occurs? I think the mouse makes it easier to observe compared to other peripherals like the keyboard. Alongside this, there is also some kind of jitter which is impacting the presentation smoothness, be it games or scrolling text in a browser, making everything look like it has a subtle ghosting effect or like when there is increase in display response times.
The first time I observed, I wondered whether it was just the way it was or it was an odd Windows behavior. Interestingly, Linux felt the same way too. Was also left clueless as to why PlayStation 3 felt much smoother compared to PC even considering the steady frame pacing. After digging through a bunch of OS related features, I came to know that most modern operating systems function in “Tickless” or “Dynamic Tick” mode by default. This wasn’t a thing during PS3 days and Windows only started implementing it from Windows 8. Why show interest in this feature particularly? Because it is related to system interrupts which correlates to timings and inputs. Before Windows 8 (let’s also include PS3 because it was released priorly), interrupts were processed in “Periodic” mode, where interrupts are processed at intervals strictly based on the tick rate of the operating systems (15.625 ms default timer resolution on Windows) and continue to run even under idle states. So, out of curiosity, I went ahead and disabled this feature. To my surprise, everything felt on point, ranging from inputs to smoothness, as smooth as how I remembered PS3 games used to feel. 30 FPS on PC doesn’t feel as jerky but smooth as how PS3 presented it. Obviously, disabling the Dynamic Tick feature impacts power usage by preventing CPUs from entering idle states. And then I thought, if the Dynamic Tick feature is preventing CPUs from entering idle states, perhaps it is the “C-states” that are causing this phenomenon in the first place and not due to the interrupt rate. I went ahead and re-enabled the Dynamic Tick feature and limited C-states to C1 only (since C1 has the least transition latency). And there it is, everything snapped back to consistent behavior again, just as when Dynamic Tick is disabled.
Monitoring C-states in “HWiNFO” software shows cores enter C6 state frequently even during gameplay and of course, very frequently during idle. I am assuming that the frequent C-state induced skewed timings, cache flushes, voltage variations, PLL shut offs etc., are the reasons for the mentioned phenomenon. Nevertheless, Dynamic Tick and C-state features are the standard for every desktop PC in the market and the subtle abnormalities wouldn’t bother most users. Even PCs configured for Esports might have left these features enabled, so there’s that.
Feel free to share your thoughts.
I am here to share the findings from which I have curiously tinkered to find out the reason for this abnormal feeling of inconsistency with inputs, as well as the overall feel of the system. This phenomenon is not limited to one PC, but any PC that has C-states or Dynamic Tick feature enabled.
The phenomenon is the drift or delay in mouse movements which can be noticeable easily when moving the mouse in O-shape or X-shape. I am not sure if the term “Delay” is appropriate to use because it feels more like a drift in movements. Is it only with the mouse that this occurs? I think the mouse makes it easier to observe compared to other peripherals like the keyboard. Alongside this, there is also some kind of jitter which is impacting the presentation smoothness, be it games or scrolling text in a browser, making everything look like it has a subtle ghosting effect or like when there is increase in display response times.
The first time I observed, I wondered whether it was just the way it was or it was an odd Windows behavior. Interestingly, Linux felt the same way too. Was also left clueless as to why PlayStation 3 felt much smoother compared to PC even considering the steady frame pacing. After digging through a bunch of OS related features, I came to know that most modern operating systems function in “Tickless” or “Dynamic Tick” mode by default. This wasn’t a thing during PS3 days and Windows only started implementing it from Windows 8. Why show interest in this feature particularly? Because it is related to system interrupts which correlates to timings and inputs. Before Windows 8 (let’s also include PS3 because it was released priorly), interrupts were processed in “Periodic” mode, where interrupts are processed at intervals strictly based on the tick rate of the operating systems (15.625 ms default timer resolution on Windows) and continue to run even under idle states. So, out of curiosity, I went ahead and disabled this feature. To my surprise, everything felt on point, ranging from inputs to smoothness, as smooth as how I remembered PS3 games used to feel. 30 FPS on PC doesn’t feel as jerky but smooth as how PS3 presented it. Obviously, disabling the Dynamic Tick feature impacts power usage by preventing CPUs from entering idle states. And then I thought, if the Dynamic Tick feature is preventing CPUs from entering idle states, perhaps it is the “C-states” that are causing this phenomenon in the first place and not due to the interrupt rate. I went ahead and re-enabled the Dynamic Tick feature and limited C-states to C1 only (since C1 has the least transition latency). And there it is, everything snapped back to consistent behavior again, just as when Dynamic Tick is disabled.
Monitoring C-states in “HWiNFO” software shows cores enter C6 state frequently even during gameplay and of course, very frequently during idle. I am assuming that the frequent C-state induced skewed timings, cache flushes, voltage variations, PLL shut offs etc., are the reasons for the mentioned phenomenon. Nevertheless, Dynamic Tick and C-state features are the standard for every desktop PC in the market and the subtle abnormalities wouldn’t bother most users. Even PCs configured for Esports might have left these features enabled, so there’s that.
Feel free to share your thoughts.