mbox series

[0/2] Use REQ_OP_WRITE_SAME to implement WRITE SAME

Message ID 20190702153031.3832-1-bvanassche@acm.org (mailing list archive)
Headers show
Series Use REQ_OP_WRITE_SAME to implement WRITE SAME | expand

Message

Bart Van Assche July 2, 2019, 3:30 p.m. UTC
Hi Martin,

The SCSI target iblock backend uses regular writes to implement the SCSI WRITE
SAME command. That is suboptimal for at least SCSI and NVMe SSDs. This patch
series makes the iblock backend use REQ_OP_WRITE_SAME instead. Please consider
these patches for inclusion in the upstream kernel.

Thanks,

Bart.

Bart Van Assche (2):
  block: Add blkdev_submit_write_same()
  target/core: Use REQ_OP_WRITE_SAME to implement WRITE SAME

 block/blk-lib.c                     | 37 ++++++++++++++++++++++++++++-
 drivers/target/target_core_iblock.c | 17 +++++++++++++
 include/linux/blkdev.h              |  3 +++
 3 files changed, 56 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig July 2, 2019, 4:26 p.m. UTC | #1
I actually rather wanted to get rid of REQ_OP_WRITE_SAME entirely.
Do you have a use case for this?

Note that it isn't going to help with nvme either, as there is no
write same command in nvme.
Bart Van Assche July 2, 2019, 5:15 p.m. UTC | #2
On 7/2/19 9:26 AM, Christoph Hellwig wrote:
> I actually rather wanted to get rid of REQ_OP_WRITE_SAME entirely.
> Do you have a use case for this?

Hi Christoph,

I don't have a use case for this myself. I posted these patches because 
Roman Bolshakov reported a bug in the SCSI target WRITE SAME 
implementation. I think that means that he uses this functionality.

Bart.