SSD detection support
We need support for SSD detection for performance tuning and optimization for applications.
sd driver detects SSD based on the Medium Rotation Rate in page oxB1 in VPD.
We need to expose this to userland. One way of doing this is to expose via libdevinfo.
As of now, disk details like vendor id, model, serial number, revision id, device type etc are accessible via libdevinfo.
<snip> #define INQUIRY_DEVICE_TYPE "inquiry-device-type" /* int */ #define INQUIRY_VENDOR_ID "inquiry-vendor-id" /* string */ #define INQUIRY_PRODUCT_ID "inquiry-product-id" /* string */ #define INQUIRY_REVISION_ID "inquiry-revision-id" /* string */ #define INQUIRY_SERIAL_NO "inquiry-serial-no" /* string */ <snip>
We can add one more property which can be named as 'inquiry-device-is-solid-state'
Updated by Vineeth Pillai over 8 years ago
SBC-3 specification suggests that this MRR to be 1 if the device is SSD. This is optional though. The SSDs that I have tested complies to this, but I am not sure about very old SSDs.
It is not explicit that user land programs and libraries would need this feature, but there are many applications that use raw disk and a hint like this would be useful for them to use it more efficiently. Disk Management utilities can offer suggestions to end user based on this hint.
Hypothetical eg: database can suggest allocating SSDs to it for indexes, when admin tries to list and allocate storage media to DBMS.
To the end user also, this can be a benefit. For systems with multiple disks, this would be an easy way to list the disk and determine which ones are SSDs in the list. I understand that there are no utilities that support this, but with this feature, format, fdisk etc can be modified to expose this detail.