Thread (12 messages) 12 messages, 4 authors, 2016-08-11

Re: [PATCH v5 2/2] Add support for SCT Write Same

From: Tom Yan <hidden>
Date: 2016-08-10 20:19:42
Also in: lkml

On 10 August 2016 at 14:31, Tom Yan [off-list ref] wrote:
I don't really know about SCT Write Same but there is one concern I
could I think of.

libata's SATL would report a maximum write same length base on the
number of sectors a one-block TRIM payload can describe at most, which
is 65535 * 64 = 4194240 (see ata_scsiop_inq_b0 in libata-scsi.c). If
the drive does not support TRIM, it will not report such length. That
is technically fine, as per SBC standard, and I suppose the SCSI disk
driver would use SD_MAX_WS16_BLOCKS = 0x7fffff (8388607).
Actually it will use SD_MAX_WS10_BLOCKS = 0xffff (65535) in such case.
See sd_config_write_same() in sd.c. So if the device support TRIM,
each SCT Write Same will cover 4194240 logical sectors; if it does
not, each will cover 65535 logical sectors. In that case, perhaps we
should report the same value in the Maximum Write Same Length field
when (only) SCT Write Same is supported? (Not the Optimal Unmap
Granularity field though).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help