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

nvme: Add support for Autonomous Power State Transition #1444

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eseipi
Copy link

@eseipi eseipi commented Oct 1, 2024

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.

@eseipi eseipi requested a review from bsdimp as a code owner October 1, 2024 10:03
@bsdimp
Copy link
Member

bsdimp commented Oct 1, 2024

Generally, I like this. I'm unsure of what we should do by default...

@eseipi

This comment was marked as outdated.

@wigneddoom
Copy link

This is a great feature. But for some reason, I think that we can implement it in user space - nvmecontrol(8)

@eseipi

This comment was marked as outdated.

@bsdimp bsdimp self-assigned this Oct 4, 2024
@eseipi eseipi marked this pull request as draft October 6, 2024 08:08
@eseipi
Copy link
Author

eseipi commented Oct 7, 2024

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.

@eseipi

This comment was marked as outdated.

@eseipi eseipi marked this pull request as ready for review October 9, 2024 16:51
@eseipi eseipi force-pushed the main branch 4 times, most recently from 45d3802 to 913a3f4 Compare October 11, 2024 19:57
@eseipi

This comment was marked as outdated.

Enable use of already existing parameters, necessary for some
features such as APST.

Signed-off-by: Alexey Sukhoguzov <sap@eseipi.net>
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 <sap@eseipi.net>
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 <sap@eseipi.net>
@eseipi
Copy link
Author

eseipi commented Oct 31, 2024

I've created a revision (D47381) for nvmecontrol(8), which leaves just two things here: toggling (hw.nvme.apst_enable) and data overriding (hw.nvme.apst_data). This saves us from having to hook userspace when (re)initializing the controller, so I think it's reasonable to have this in the driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants