All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [question] the patch which affect performance of virtio-scsi
@ 2015-02-03  2:31 Wangting (Kathy)
  2015-02-03  2:56 ` Wangting (Kathy)
  2015-02-03  8:42 ` Paolo Bonzini
  0 siblings, 2 replies; 7+ messages in thread
From: Wangting (Kathy) @ 2015-02-03  2:31 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel

Hi Paolo,

Recently I test IO performance with virtio-scsi, and find out that the patch of
"virtio-scsi: add support for the any_layout feature" affects IO performance of model
with 4KB 32iodepth sequence read.

Why cdb and sense is removed from the struct of VirtIOSCSICmdReq and VirtIOSCSICmdResp?
How do you consider the impact of the changes to the performance?
Although the latest version of qemu can optimize the performance by the way of reading merger,
I think the affect of this patch cannot be ignored.

Best wishes,

Ting

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
  2015-02-03  2:31 [Qemu-devel] [question] the patch which affect performance of virtio-scsi Wangting (Kathy)
@ 2015-02-03  2:56 ` Wangting (Kathy)
  2015-02-03  8:49   ` Paolo Bonzini
  2015-02-03  8:42 ` Paolo Bonzini
  1 sibling, 1 reply; 7+ messages in thread
From: Wangting (Kathy) @ 2015-02-03  2:56 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel

Sorry, I find that the patch of "virtio-scsi: Optimize virtio_scsi_init_req" can slove this problem.

By the way, can you tell me the reason of the change about cdb and sense?

On 2015-2-3 10:31, Wangting (Kathy) wrote:
> Hi Paolo,
> 
> Recently I test IO performance with virtio-scsi, and find out that the patch of
> "virtio-scsi: add support for the any_layout feature" affects IO performance of model
> with 4KB 32iodepth sequence read.
> 
> Why cdb and sense is removed from the struct of VirtIOSCSICmdReq and VirtIOSCSICmdResp?
> How do you consider the impact of the changes to the performance?
> Although the latest version of qemu can optimize the performance by the way of reading merger,
> I think the affect of this patch cannot be ignored.
> 
> Best wishes,
> 
> Ting
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
  2015-02-03  2:31 [Qemu-devel] [question] the patch which affect performance of virtio-scsi Wangting (Kathy)
  2015-02-03  2:56 ` Wangting (Kathy)
@ 2015-02-03  8:42 ` Paolo Bonzini
  1 sibling, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-02-03  8:42 UTC (permalink / raw)
  To: Wangting (Kathy); +Cc: qemu-devel



On 03/02/2015 03:31, Wangting (Kathy) wrote:
> Hi Paolo,
> 
> Recently I test IO performance with virtio-scsi, and find out that the patch of
> "virtio-scsi: add support for the any_layout feature" affects IO performance of model
> with 4KB 32iodepth sequence read.
> 
> Why cdb and sense is removed from the struct of VirtIOSCSICmdReq and VirtIOSCSICmdResp?

Because I could not find any other way to implement ANY_LAYOUT, and
virtio 1.0 requires that feature.

The performance however was already improved in commit faf1e1f
(virtio-scsi: Optimize virtio_scsi_init_req, 2014-09-16).

Paolo

> How do you consider the impact of the changes to the performance?
> Although the latest version of qemu can optimize the performance by the way of reading merger,
> I think the affect of this patch cannot be ignored.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
  2015-02-03  2:56 ` Wangting (Kathy)
@ 2015-02-03  8:49   ` Paolo Bonzini
  2015-02-07 11:26     ` Wangting (Kathy)
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2015-02-03  8:49 UTC (permalink / raw)
  To: Wangting (Kathy); +Cc: qemu-devel

On 03/02/2015 03:56, Wangting (Kathy) wrote:
> Sorry, I find that the patch of "virtio-scsi: Optimize virtio_scsi_init_req" can slove this problem.

Great that you could confirm that. :)

> By the way, can you tell me the reason of the change about cdb and sense?

cdb and sense are variable-size items.  ANY_LAYOUT support changed
VirtIOSCSIReq: instead of having a pointer to the request, it copies the
request from guest memory into VirtIOSCSIReq.  This is required because
the request might not be contiguous in guest memory.  And because the
request and response headers (e.g. VirtIOSCSICmdReq and
VirtIOSCSICmdResp) are included by value in VirtIOSCSIReq, the
variable-sized fields have to be treated specially.

Only one of them can remain in VirtIOSCSIReq, because you cannot have a
flexible array member (e.g. "uint_8 sense[];") in the middle of a struct.

cdb is always used, so it is chosen for the variable-sized part of
VirtIOSCSIReq: cdb was simply moved from VirtIOSCSICmdReq to VirtIOSCSIReq.

Instead, requests that complete with sense data are not a fast path.
Hence sense is retrieved from the SCSIRequest, and
virtio_scsi_command_complete copies it into the guest buffer via
scsi_req_get_sense + qemu_iovec_from_buf.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
  2015-02-03  8:49   ` Paolo Bonzini
@ 2015-02-07 11:26     ` Wangting (Kathy)
  2015-02-08 10:10       ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Wangting (Kathy) @ 2015-02-07 11:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

OK, Thank you very much for your detailed explanation.

But I have another question about the big change from qemu-1.5.3 to qemu-1.6.0-rc0.

When I use ramdisk for IO performance testing, the result is as follows.

[fio-test]          rw         bs         iodepth    jobs       bw         iops
------------------------------------------------------------------------------------
qemu-1.5.3          read       4k         32          1         285MB/s    73208
qemu-1.6.0-rc0      read       4k         32          1         253MB/s    64967

And virtio-blk is the same.

I know there are so many differences between qemu-1.5 and qemu-1.6, but I am confused about
what new features impact the performance so much. Do you know it?


On 2015-2-3 16:49, Paolo Bonzini wrote:
> On 03/02/2015 03:56, Wangting (Kathy) wrote:
>> Sorry, I find that the patch of "virtio-scsi: Optimize virtio_scsi_init_req" can slove this problem.
> 
> Great that you could confirm that. :)
> 
>> By the way, can you tell me the reason of the change about cdb and sense?
> 
> cdb and sense are variable-size items.  ANY_LAYOUT support changed
> VirtIOSCSIReq: instead of having a pointer to the request, it copies the
> request from guest memory into VirtIOSCSIReq.  This is required because
> the request might not be contiguous in guest memory.  And because the
> request and response headers (e.g. VirtIOSCSICmdReq and
> VirtIOSCSICmdResp) are included by value in VirtIOSCSIReq, the
> variable-sized fields have to be treated specially.
> 
> Only one of them can remain in VirtIOSCSIReq, because you cannot have a
> flexible array member (e.g. "uint_8 sense[];") in the middle of a struct.
> 
> cdb is always used, so it is chosen for the variable-sized part of
> VirtIOSCSIReq: cdb was simply moved from VirtIOSCSICmdReq to VirtIOSCSIReq.
> 
> Instead, requests that complete with sense data are not a fast path.
> Hence sense is retrieved from the SCSIRequest, and
> virtio_scsi_command_complete copies it into the guest buffer via
> scsi_req_get_sense + qemu_iovec_from_buf.
> 
> Paolo
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
  2015-02-07 11:26     ` Wangting (Kathy)
@ 2015-02-08 10:10       ` Paolo Bonzini
  2015-02-09  2:53         ` Wangting (Kathy)
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2015-02-08 10:10 UTC (permalink / raw)
  To: Wangting (Kathy), qemu-devel



On 07/02/2015 12:26, Wangting (Kathy) wrote:
> OK, Thank you very much for your detailed explanation.
> 
> But I have another question about the big change from qemu-1.5.3 to qemu-1.6.0-rc0.
> 
> When I use ramdisk for IO performance testing, the result is as follows.
> 
> [fio-test]          rw         bs         iodepth    jobs       bw         iops
> ------------------------------------------------------------------------------------
> qemu-1.5.3          read       4k         32          1         285MB/s    73208
> qemu-1.6.0-rc0      read       4k         32          1         253MB/s    64967
> 
> And virtio-blk is the same.
> 
> I know there are so many differences between qemu-1.5 and qemu-1.6, but I am confused about
> what new features impact the performance so much. Do you know it?

No, sorry.  Please try newer versions first and see if this was fixed.
QEMU 1.6 is more than a year old.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
  2015-02-08 10:10       ` Paolo Bonzini
@ 2015-02-09  2:53         ` Wangting (Kathy)
  0 siblings, 0 replies; 7+ messages in thread
From: Wangting (Kathy) @ 2015-02-09  2:53 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel



On 2015-2-8 18:10, Paolo Bonzini wrote:
> 
> 
> On 07/02/2015 12:26, Wangting (Kathy) wrote:
>> OK, Thank you very much for your detailed explanation.
>>
>> But I have another question about the big change from qemu-1.5.3 to qemu-1.6.0-rc0.
>>
>> When I use ramdisk for IO performance testing, the result is as follows.
>>
>> [fio-test]          rw         bs         iodepth    jobs       bw         iops
>> ------------------------------------------------------------------------------------
>> qemu-1.5.3          read       4k         32          1         285MB/s    73208
>> qemu-1.6.0-rc0      read       4k         32          1         253MB/s    64967
>>
>> And virtio-blk is the same.
>>
>> I know there are so many differences between qemu-1.5 and qemu-1.6, but I am confused about
>> what new features impact the performance so much. Do you know it?
> 
> No, sorry.  Please try newer versions first and see if this was fixed.
> QEMU 1.6 is more than a year old.
> 
> Paolo
> 
> 

OK, thanks.

Ting

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-09  2:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03  2:31 [Qemu-devel] [question] the patch which affect performance of virtio-scsi Wangting (Kathy)
2015-02-03  2:56 ` Wangting (Kathy)
2015-02-03  8:49   ` Paolo Bonzini
2015-02-07 11:26     ` Wangting (Kathy)
2015-02-08 10:10       ` Paolo Bonzini
2015-02-09  2:53         ` Wangting (Kathy)
2015-02-03  8:42 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.