On 12/5/22 10:24, Jens Axboe wrote: > On 12/5/22 9:20 AM, Alvaro Karsz wrote: >> Implement the VIRTIO_BLK_F_LIFETIME feature for VirtIO block devices. >> >> This commit introduces a new ioctl command, VBLK_LIFETIME. >> >> VBLK_LIFETIME ioctl asks for the block device to provide lifetime >> information by sending a VIRTIO_BLK_T_GET_LIFETIME command to the device. >> >> lifetime information fields: >> >> - pre_eol_info: specifies the percentage of reserved blocks that are >> consumed. >> optional values following virtio spec: >> *) 0 - undefined. >> *) 1 - normal, < 80% of reserved blocks are consumed. >> *) 2 - warning, 80% of reserved blocks are consumed. >> *) 3 - urgent, 90% of reserved blocks are consumed. >> >> - device_lifetime_est_typ_a: this field refers to wear of SLC cells and >> is provided in increments of 10used, and so >> on, thru to 11 meaning estimated lifetime >> exceeded. All values above 11 are reserved. >> >> - device_lifetime_est_typ_b: this field refers to wear of MLC cells and is >> provided with the same semantics as >> device_lifetime_est_typ_a. >> >> The data received from the device will be sent as is to the user. >> No data check/decode is done by virtblk. > > Is this based on some spec? Because it looks pretty odd to me. There > can be a pretty wide range of two/three/etc level cells with wildly > different ranges of durability. And there's really not a lot of slc > for generic devices these days, if any. > This is exactly what I said on initial version about new types ... -ck