engines/sg: support trim operations via the UNMAP command
authorVincent Fu <vincent.fu@wdc.com>
Thu, 24 May 2018 21:00:36 +0000 (17:00 -0400)
committerVincent Fu <vincent.fu@wdc.com>
Thu, 26 Jul 2018 16:34:57 +0000 (09:34 -0700)
commitb4b9665e89e2f6a25ca8e2b99207d95d4d7b5154
tree0f316a764cdb6cc6427136706f2bb00258fcf914
parentec3e36481f88dc731d7d52030a51fc68b970db3f
engines/sg: support trim operations via the UNMAP command

Multiple trim ranges can be submitted with a single UNMAP command
for character devices (e.g., /dev/sg1) using iodepth_batch. For
example, with iodepth_batch=4, each UNMAP command will include
four ranges. IOPS will still be reported as if four IO operations
were carried out.

Note that currently sg only supports a maximum of 16 commands
in flight per file. So be sure to maintain (iodepth/iodepth_batch) <= 16.
engines/sg.c