-
Notifications
You must be signed in to change notification settings - Fork 256
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
Replace heim with sysfs and dont wake devices #805
Replace heim with sysfs and dont wake devices #805
Conversation
This commit replaces heim sensor reading with manual sysfs sensor reading, and skips reading sensors for any device that is in ACPI D3cold This has the notable downside of still keeping a device awake, which I hope to solve in a later commit
They were referring to files i ultimately decided against using in this implementation, and so were no longer relevant to document.
That PR is #807 |
Codecov ReportBase: 23.66% // Head: 23.59% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #805 +/- ##
==========================================
- Coverage 23.66% 23.59% -0.07%
==========================================
Files 60 60
Lines 13239 13276 +37
==========================================
Hits 3133 3133
- Misses 10106 10143 +37
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Some numbers on just how much this change improves things for laptop users like me, my iGPU reports consuming 0.008 watts while browsing the web the dGPU reports consuming 6 watts while doing nothing in ACPI D0, a massive waste of power that, now, (mostly) wont happen. For comparison, total system power usage when idle, looking at a web page, is as low as 6 watts. the dGPU being idle doubles total system power usage all by itself |
I'm currently stuck on figuring out a good way for bottom to not block power saving. My current thoughts are reading the
If some way can be found to specifically poll some sensors at a different rate, then in combination with checking if the GPU is in use(so that you get useful sensor updates when actually using the dGPU), we can simply wait if its idle, and the device will go to sleep itself, and code in this PR will then keep it asleep, perfectly solving the problem. if.. At least as a workaround, this PR will actually cause filtered sensors not to be polled, which means a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes seem fine to me, and I tested it locally on my computer that just has a dGPU just as another check and it seems to work fine there too.
Really thankful for both sending the issue (I had never even considered this as a problem, so that was interesting to look into), and taking the time to submit a PR. @all-contributors please add @DianaNites for code |
I've put up a pull request to add @DianaNites! 🎉 |
Description
This commit replaces heim sensor reading with manual sysfs sensor reading, and skips reading sensors for any device that is in ACPI D3cold, instead returning 0.
This has the notable downside of still keeping a device awake, which I hope to solve in a later commit or PR
Another notable potential issue with this PR is that, while heim has its own method for async reading of files, bottom itself does not seem to, and I didnt want to arbitrarily pull in a dependency to do that, so even though
get_temperature_data
is async, I used the normal sync I/O methods. I justify this by the fact that sysfs is in-memory and presumably shouldnt block for the operations being done here.Changing this should be relatively easy if need be and a path is decided
To the best of my knowledge, this change has no other user-visible affect, all sensors that appeared before will continue to appear. This sysfs reading is what heim does under the hood anyway, nothing fancy.
Screenshot:
Issue
#803
Closes: #803
Testing
If relevant, please state how this was tested. All changes must be tested to work: Manually checked that the GPU was not woken up, and that when it was by an external source, bottom started displaying the real sensor values
If this is a code change, please also indicate which platforms were tested:
Checklist
If relevant, ensure the following have been met:
cargo fmt
)README.md
, help menu, etc.)