New DRAM-less NVME SSDs use a portion of the system memory as HMB (Host memory buffer).
How can I check / change NVME HMB on Linux?
(to verify it is working correctly or alter its behavior)
New DRAM-less NVME SSDs use a portion of the system memory as HMB (Host memory buffer).
How can I check / change NVME HMB on Linux?
(to verify it is working correctly or alter its behavior)
According to the NVMe base specification 2.0a, the NVME feature ID for the Host Memory Buffer is 0x0d. You can check it with the nvme get-feature command:
# nvme get-feature /dev/nvme0 -H -f 0x0d
get-feature:0xd (Host Memory Buffer), Current value:0x000001
Memory Return (MR): False
Enable Host Memory (EHM): Enabled
Host Memory Descriptor List Entry Count (HMDLEC): 10
Host Memory Descriptor List Address (HMDLAU): 0x0
Host Memory Descriptor List Address (HMDLAL): 0xffff7000
Host Memory Buffer Size (HSIZE): 9728
You can also find some information under /sys/class/nvme/, in the directory of the respective NVMe controller.
The nvme kernel module also has the max_host_mem_size_mb parameter which you can use to limit the maximum HMB size per controller.
Another nvme module parameter, use_cmb_sqes can be used to forbid the use of controller's memory buffer for I/O SQes. Assuming I've understood this correctly, this could be used to make any NVMe work like a DRAM-less one.
You can find the current values for the module parameters at /sys/module/nvme/parameters/, and also change some of them dynamically from there.