qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]