Bug 95751 - SSD discard granularity (erase unit size) and "deterministic read zero" are not detected by kernel
Summary: SSD discard granularity (erase unit size) and "deterministic read zero" are n...
Status: NEW
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Serial ATA (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Tejun Heo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-28 05:02 UTC by Ivan Shapovalov
Modified: 2015-03-28 05:02 UTC (History)
0 users

See Also:
Kernel Version: 3.19.2
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Ivan Shapovalov 2015-03-28 05:02:59 UTC
At least with some SATA SSDs (OCZ Vertex 4 and Lite-on LSS-16L6G), when using the AHCI SATA driver, kernel cannot detect TRIM granularity and "deterministic read zero after TRIM" property, although both are correctly read by hdparm.

Following commands illustrate the bug:

$ lsblk -D /dev/disk/by-id/ata-LITEONIT_LSS-16L6G_S0C41154Z1ZSCA185984
NAME   DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sdb           0      512B       2G         0
├─sdb1        0      512B       2G         0
├─sdb2        0      512B       2G         0
└─sdb3        0      512B       2G         0

# hdparm -I /dev/disk/by-id/ata-LITEONIT_LSS-16L6G_S0C41154Z1ZSCA185984 | grep TRIM
	   *	Data Set Management TRIM supported (limit 8 blocks)
	   *	Deterministic read ZEROs after TRIM

In lsblk output, columns DISC-GRAN and DISC-ZERO in all rows should have values 4K and 1, respectively.

Direct testing with `hdparm --trim-sector-ranges` and `hdparm --read-sector` demonstrates that hdparm output is the correct one.

Note You need to log in before you can comment on or make changes to this bug.