Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display core parking indicator when hovering the mouse over the processor graphs #2040

Merged
merged 6 commits into from May 17, 2024

Conversation

wnstngs
Copy link
Contributor

@wnstngs wnstngs commented Apr 23, 2024

Purpose

Starting with Windows 7, the thread scheduler and processor power manager are able to park processors for power saving purposes. Parking a processor makes it unavailable for thread scheduling, which contributes to potentially putting this processor into a deep idle state and thus reducing power consumption. Parked cores are marked as "Parked" in Task Manager, but not in System Informer.

This PR adds support for displaying core parking status in the tooltip when hovering over the processor graphs. Previously there was a proposal to add such a feature: #1083

Proposed changes

  1. Function that determines whether a core is parked. This uses the powerful CPU Sets mechanism available since Windows 10. Currently, every logical processor has a CPU Set and this looks like the most convenient and reliable way to determine if a specific core is parked.
  2. Display "Parked" in the tooltip if the core is parked. https://imgur.com/a/Z1iDT8W

TODO?

  1. Revise the tooltip formatting code, as in the current form it easily becomes even more confusing when adding new functionality (format indexes change depending on different conditions). For example, at least use named variables for indexes of certain components of the tooltip (load percentages, relationships, time, and so on).
  2. Consider using the CPU Sets mechanism in more places.

Copy link

github-actions bot commented Apr 23, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@wnstngs
Copy link
Contributor Author

wnstngs commented Apr 23, 2024

I have read the CLA Document and I hereby sign the CLA

Copy link
Member

@jxy-s jxy-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wnstngs thanks for the contribution! I agree with showing the parked state in the tooltip. I have some feedback. Either I can merge this as and and go back to address it myself, or you can do so. Let me know how you'd like to handle it.

SystemInformer/syssccpu.c Outdated Show resolved Hide resolved
SystemInformer/syssccpu.c Show resolved Hide resolved
SystemInformer/syssccpu.c Outdated Show resolved Hide resolved
SystemInformer/syssccpu.c Outdated Show resolved Hide resolved
… Don't pass a handle to a process as we aren't interested in whether CPU set is allocated to any process (the indirected handle still has to be valid and point to 0).
…ffset to the next set when iterating CPU sets instead of indexing.
@wnstngs wnstngs requested a review from jxy-s April 25, 2024 15:56
Copy link
Member

@jxy-s jxy-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, thanks for the contribution! I will merge this when I have time - there is some cleanup I want to do after it gets merged, specifically around the juggling the formatting of the string mentioned in the PR.

@jxy-s jxy-s merged commit c37d551 into winsiderss:master May 17, 2024
3 checks passed
@wnstngs
Copy link
Contributor Author

wnstngs commented May 17, 2024

@jxy-s Thank you!

@wnstngs wnstngs deleted the CoreParking branch May 17, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants