NVMe Tuning
#1
I have tried to follow the Wiki section to set the power profile of the NVMe SSD.

        sudo nvme /dev/nvme0 id-ctrl /dev/nvme0 

returns:

        ps    0 : mp:3.30W operational enlat:0 exlat:0 rrt:0 rrl:0
                  rwt:0 rwl:0 idle_power:- active_power:-
        ps    1 : mp:2.70W operational enlat:0 exlat:0 rrt:1 rrl:1
                  rwt:1 rwl:1 idle_power:- active_power:-
        ps    2 : mp:2.30W operational enlat:0 exlat:0 rrt:2 rrl:2
                  rwt:2 rwl:2 idle_power:- active_power:-
        ps    3 : mp:0.0500W non-operational enlat:10000 exlat:45000 rrt:4 rrl:4
                  rwt:4 rwl:4 idle_power:- active_power:-
        ps    4 : mp:0.0050W non-operational enlat:10000 exlat:50000 rrt:4 rrl:4
                  rwt:4 rwl:4 idle_power:- active_power:-

Not really sure hot to decypher the output, but I'm assuming that ps 2 is the profile I want as its the lowest power with the drive operational.

I have tried setting this profile using 
        sudo nvme /set-feature /dev/nvme0 -f 2 -v 2

This seems to work until a reboot when it defaults back to profile 0.

Is there a command missing to save it to the NVMe?

Also after googling to try and find how to make NVMe setting persistant, I found some references to enabling Autonomous Power State Transistion rather than editing the power management. 
Which is the correct one to use APST (feature 0x0c) or Power Managment (feature 2) and how to make these setting persistent?
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
  Reply
#2
(01-09-2020, 03:22 PM)gandlers Wrote: I have tried to follow the Wiki section to set the power profile of the NVMe SSD.
...
This seems to work until a reboot when it defaults back to profile 0.

Is there a command missing to save it to the NVMe?
...

Yes, there does appear to be a command missing to make it persistant across reboots & power cycles.
I think this is what we are looking for;
Code:
-s, --save
   Save the attribute so that it persists through all power states and resets.

So the command in both the example and your case is probably;
Code:
$ sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s
Whence someone has tested that, I'll update the Wiki and remove the note about the non-persistant nature I just added.

(01-09-2020, 03:22 PM)gandlers Wrote: ...
Also after googling to try and find how to make NVMe setting persistant, I found some references to enabling Autonomous Power State Transistion rather than editing the power management.
Which is the correct one to use APST (feature 0x0c) or Power Managment (feature 2) and how to make these setting persistent?
I don't know anything about APST / Autonomous Power State Transistion.
--
Arwen Evenstar
Princess of Rivendale
  Reply
#3
(01-10-2020, 08:49 AM)Arwen Wrote:
Code:
$ sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s

Whence someone has tested that, I'll update the Wiki and remove the note about the non-persistant nature I just added.

Arwen,

That's the secret ingredient, the -s switch was indeed required to save it.
Rebooting no longer sets it back to 0.

Many thanks  Big Grin
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
  Reply
#4
Great. You are welcome. Wiki updated.
--
Arwen Evenstar
Princess of Rivendale
  Reply
#5
May I ask where you found the info regarding the missing switch?

I tried "man nvme", "sudo nvme --help" and obviously googled it but never found info regarding the switches.
I can't find info on the -H switch for example, but that appears to be a "make human readable" switch
Information about the feature-ids also seem to be a closely guarded secret. I would have expected there to be a list of NMVe FID's but google let me down on that one too!
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
  Reply
#6
This might be a different source than what Arwen found, but I found a page that explains the -s option here:  https://manpages.ubuntu.com/manpages/bio...ure.1.html  

I found this after reading your post this morning, and was going to reply suggesting -s, but when I tried it on my own desktop it didn't work so I didn't reply.  Luckily Arwin did.

I wonder why I'm getting an error but you are not.  When I run:


Quote:sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s

After I type my password it comes back:


Quote:NVMe Status:FEATURE_NOT_SAVEABLE(10d)

I don't have my PBP yet, this was on my 9 year old X86 desktop running Mint.  This isn't really a problem on my desktop though.
  Reply
#7
(01-10-2020, 10:39 AM)gandlers Wrote: May I ask where you found the info regarding the missing switch?

I tried "man nvme", "sudo nvme --help" and obviously googled it but never found info regarding the switches.
I can't find info on the -H switch for example, but that appears to be a "make human readable" switch
Information about the feature-ids also seem to be a closely guarded secret. I would have expected there to be a list of NMVe FID's but google let me down on that one too!

In the NVMe package I have on my Linux desktop, the "man nvme" simply shows what other manual pages are available. So I found "man nvme-set-feature" which has the "-s" option.

I did not find any cross reference of what does what, but did not look too hard. I may have added the Wiki entry, but the actual commands are from someone else here in the forums.

(01-10-2020, 02:33 PM)Redbeard Wrote: This might be a different source than what Arwen found, but I found a page that explains the -s option here:  https://manpages.ubuntu.com/manpages/bio...ure.1.html  

I found this after reading your post this morning, and was going to reply suggesting -s, but when I tried it on my own desktop it didn't work so I didn't reply.  Luckily Arwen did.

I wonder why I'm getting an error but you are not.  When I run:
Quote:sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s


After I type my password it comes back:
Quote:NVMe Status:FEATURE_NOT_SAVEABLE(10d)


I don't have my PBP yet, this was on my 9 year old X86 desktop running Mint.  This isn't really a problem on my desktop though.

First, do you have a NVMe on your 9 year old X86 desktop?
Second, did you run the command, "sudo nvme id-ctrl /dev/nvme0", to get the power settings of your NVMe?

My desktop has 2 NVMe SSD drives, and only 1 has the ability to change it's power settings. The other does not. Thus, it would likely fail like yours.
--
Arwen Evenstar
Princess of Rivendale
  Reply
#8
Cheers for the info guys.

Ah, there are other man pages (as highlighted in bold).

Now I know how that works I have the -s switch right here infront of me in my terminal window,
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
  Reply
#9
@gandlers, Live and learn.

Another useful Unix command to find manual pages, though I can't be certain it is on all Linux distros, is "apropos".
For example, I tried this just now;
Code:
> apropos sky        
skytentacles (6)     - 3D tentacles from the sky!
Which ended up being a X-Windows screen saver.
--
Arwen Evenstar
Princess of Rivendale
  Reply
#10
@Arwin


Quote:First, do you have a NVMe on your 9 year old X86 desktop?

Yes.  I have an Intel 660p Series M.2 2280 1TB PCIe NVMe mounted in an adapter in a free PCIe slot.

Quote:Second, did you run the command, "sudo nvme id-ctrl /dev/nvme0", to get the power settings of your NVMe?

My desktop has 2 NVMe SSD drives, and only 1 has the ability to change it's power settings. The other does not. Thus, it would likely fail like yours.

Yes.  When I run "sudo nvme id-ctrl /dev/nvme0" it comes back with the following power settings:


Quote:ps    0 : mp:4.00W operational enlat:0 exlat:0 rrt:0 rrl:0
          rwt:0 rwl:0 idle_power:- active_power:-
ps    1 : mp:3.00W operational enlat:0 exlat:0 rrt:1 rrl:1
          rwt:1 rwl:1 idle_power:- active_power:-
ps    2 : mp:2.20W operational enlat:0 exlat:0 rrt:2 rrl:2
          rwt:2 rwl:2 idle_power:- active_power:-
ps    3 : mp:0.0300W non-operational enlat:5000 exlat:5000 rrt:3 rrl:3
          rwt:3 rwl:3 idle_power:- active_power:-
ps    4 : mp:0.0040W non-operational enlat:5000 exlat:9000 rrt:4 rrl:4
          rwt:4 rwl:4 idle_power:- active_power:-

What is strange is I can set the power value, so long as I don't use the -s option.  I've replaced my user name and my path at the terminal with "#############?" below: 
Quote:#############? sudo nvme set-feature /dev/nvme0 -f 2 -v 2
set-feature:02 (Power Management), value:0x000002
#############? sudo nvme get-feature /dev/nvme0 -f 2
get-feature:0x2 (Power Management), Current value:0x000002
#############? sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s
NVMe Status:FEATURE_NOT_SAVEABLE(10d)

As I noted above, this isn't really an issue for me.  But it did throw me off a bit.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Has your NVMe affected your battery at all? tophneal 29 421 01-17-2020, 03:03 PM
Last Post: as400
  NVMe Adapter Ribbon Cable Kaythe 10 419 01-09-2020, 07:18 PM
Last Post: bcnaz
Exclamation Incompatible NVMe SSD - Silicon Power P34A60 gandlers 6 211 01-09-2020, 03:05 PM
Last Post: gandlers
  New NVMe SSD not seen by OSes tophneal 10 335 01-08-2020, 12:18 PM
Last Post: Redbeard
Thumbs Up *** Intel NVME 660p SSD Success Story *** MiiCode2 9 1,034 01-02-2020, 01:59 PM
Last Post: Redbeard
  Samsung 970 EVO SSD 1TB - M.2 NVMe works on workstation but not Pinebook Pro mgchristensen 4 296 12-30-2019, 10:20 AM
Last Post: belfastraven
  NVMe power issue? tsys 17 1,102 12-26-2019, 01:38 PM
Last Post: tophneal
  Adding the NVME causes boot loop? swulff 7 288 12-20-2019, 08:11 PM
Last Post: Arwen
  PCIe 4X socket for optional NVMe adapter -retaing clip broken . ndp 9 389 12-19-2019, 05:15 AM
Last Post: ndp
  Pro NVMe adapter Does not fit ! ? bcnaz 77 5,389 12-17-2019, 02:42 PM
Last Post: zaius

Forum Jump:


Users browsing this thread: 1 Guest(s)