virtio-scsi: Optimize virtio_scsi_init_req
commitfaf1e1fb4cdd3f1f71c948cb53e7d50f0798a202
authorFam Zheng <famz@redhat.com>
Tue, 16 Sep 2014 07:20:18 +0000 (16 15:20 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 23 Sep 2014 13:40:51 +0000 (23 15:40 +0200)
treef2e3147381d466782ceca7eabb81664309a073b5
parent61e68b3fbd3e2b7beb636bc56f78d9c1ca25e8f9
virtio-scsi: Optimize virtio_scsi_init_req

The VirtQueueElement is a very big structure (>48k!), since it will be
initialzed by virtqueue_pop, we can save the expensive zeroing here.

This saves a few microseconds per request in my test:

[fio-test]      rw         bs         iodepth    jobs       bw         iops       latency
--------------------------------------------------------------------------------------------
Before          read       4k         1          1          110        28269      34
After           read       4k         1          1          131        33745      28

Whereas,

virtio-blk      read       4k         1          1          217        55673      16

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/virtio-scsi.c