[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 20/20] scsi-disk: correctly implement WRITE S
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 20/20] scsi-disk: correctly implement WRITE SAME |
Date: |
Tue, 19 Nov 2013 18:31:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 19/11/2013 18:23, ronnie sahlberg ha scritto:
> +#define SCSI_WRITE_SAME_MAX 524288
> ...
> + data->iov.iov_len = MIN(data->nb_sectors * 512, SCSI_WRITE_SAME_MAX);
>
> I don't think you should just clamp the data to 512k, instead I think
> you should report the 512k max write same size through
> BlockLimitsVPD/MaximumWriteSameLength to the initiator.
> Then instead of clamping the write to MIN() you return a check
> condition if the initiator sends too much.
This would not work if the BlockDriverState has a large
write_same_alignment (e.g. a qcow2 file with 1 MB cluster size).
The only purpose of the above clamping is to avoid using too much memory
when emulating WRITE SAME; there is no intrinsic limit in the length of
a WRITE SAME command that QEMU supports. There is no particular need to
have 1:1 mapping from guest to host, for two reasons:
(1) even though this is not a fast path, every additional round trip hurts
(2) the code in this patch ensures that the 512 kb writes are
serialized. If the guest works around the maximum WRITE SAME length by
sending many parallel requests, there will be no speed improvement, only
a lot more stress on the storage.
Paolo
- Re: [Qemu-devel] [PATCH v2 13/20] block/iscsi: use UNMAP to write zeroes if LBPRZ=1, (continued)
- [Qemu-devel] [PATCH v2 14/20] raw-posix: implement write_zeroes with MAY_UNMAP for files, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 15/20] raw-posix: implement write_zeroes with MAY_UNMAP for block devices, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 16/20] raw-posix: add support for write_zeroes on XFS and block devices, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 17/20] qemu-iotests: 033 is fast, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 18/20] scsi-disk: catch write protection errors in UNMAP, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 19/20] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 20/20] scsi-disk: correctly implement WRITE SAME, Paolo Bonzini, 2013/11/19