-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
nvme: Add support for Autonomous Power State Transition #1444
base: main
Are you sure you want to change the base?
Conversation
Generally, I like this. I'm unsure of what we should do by default... |
This is a great feature. But for some reason, I think that we can implement it in user space - nvmecontrol(8) |
This comment was marked as outdated.
This comment was marked as outdated.
Though my approach to configuring APST closely resembles the Linux implementation, I agree that its design could be improved. In particular, I totally agree with @wigneddoom on moving as much functionality as possible out of kernel, though I'm still considering the best way to achieve this. I've marked this PR as a draft, so I can take some time to give it more thought. Please remove the needs-review label for now. |
45d3802
to
913a3f4
Compare
I've created a revision (D47381) for |
Signed-off-by: Alexey Sukhoguzov <[email protected]>
APST is an optional NVMe power-saving feature that allows devices to autonomously enter higher non-operational power states after a certain amount of idle time, reducing the controller's overall power consumption. Signed-off-by: Alexey Sukhoguzov <[email protected]>
The apst_data tunable allows APST configuration to be adjusted during controller initialization. It accepts an array of encoded integers, each defining specific transition parameters. Signed-off-by: Alexey Sukhoguzov <[email protected]>
Fixes:
|
APST is an optional NVMe power-saving feature that allows devices to autonomously enter higher non-operational power states after a certain amount of idle time, reducing the controller's overall power consumption.
On my laptop with a Toshiba XG5, the ability to adjust APST settings allowed me to nearly double the battery life (from about 6 to 11 hours) and reduce the temperature of both the CPU and the controller by about 20°C.
At the moment, the code is very simple: the driver checks two new kenv variables (
hw.nvme.apst_enable
andhw.nvme.apst_data
) at initialization and submit the Set Features command with those values, if any (for more info see 5.1.25.1.6 of NVM Express Base Specification rev. 2.1). If onlyapst_enable
is set, the transition data is retrieved from the controller itself, but AFAIK the spec doesn't say anything about its presence being mandatory. Right now I only have two devices, and both have sane defaults.Linux is doing the whole thing differently: each time it generates the data based on available power states, some set of user-provided parameters such as latency and tolerance, and a bit of heuristic. I used similar approach at first, but after afedorov@ feedback and a little more thought, moved all that kind of stuff to userspace (D47381). In either case, any further comments/ideas on this matter would be greatly appreciated.