qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 61e68b: scsi: Optimize scsi_req_alloc


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 61e68b: scsi: Optimize scsi_req_alloc
Date: Tue, 30 Sep 2014 11:00:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 61e68b3fbd3e2b7beb636bc56f78d9c1ca25e8f9
      
https://github.com/qemu/qemu/commit/61e68b3fbd3e2b7beb636bc56f78d9c1ca25e8f9
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M include/hw/scsi/scsi.h

  Log Message:
  -----------
  scsi: Optimize scsi_req_alloc

Zeroing sense buffer for each scsi request is not efficient, we can just
leave it uninitialized because sense_len is set to 0.

Move the implicitly zeroed fields to the end of the structure and use a
partial memset.

The explicitly initialized fields (by scsi_req_alloc or scsi_req_new)
are moved to the beginning of the structure, before sense buffer, to
skip the memset.

Also change g_malloc0 to g_slice_alloc.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: faf1e1fb4cdd3f1f71c948cb53e7d50f0798a202
      
https://github.com/qemu/qemu/commit/faf1e1fb4cdd3f1f71c948cb53e7d50f0798a202
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 7ce0425575745a40e94e75426607e0bec17899fa
      
https://github.com/qemu/qemu/commit/7ce0425575745a40e94e75426607e0bec17899fa
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/vhost-scsi.c

  Log Message:
  -----------
  vhost-scsi: use virtio_ldl_p

This helps for cross-endian configurations.

Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9df7bfddcc25a22b99be5fe9b14ce367fa43b106
      
https://github.com/qemu/qemu/commit/9df7bfddcc25a22b99be5fe9b14ce367fa43b106
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: clean up virtio_scsi_parse_cdb

The command direction according to the guest-passed buffers
is already stored in the VirtIOSCSIReq.  We can use it instead
of computing it again from req->elem.

Cc: Laszlo Ersek <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: bf359a445e780815866327891a845071197dfb63
      
https://github.com/qemu/qemu/commit/bf359a445e780815866327891a845071197dfb63
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Split virtio_scsi_handle_cmd_req from virtio_scsi_handle_cmd

This is the "common part" to handle one cmd request. Refactor out for
later usage of dataplane iothread code.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: dc56b7c4fb0c95a9648ad5bf29e09e5676404077
      
https://github.com/qemu/qemu/commit/dc56b7c4fb0c95a9648ad5bf29e09e5676404077
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Split virtio_scsi_handle_ctrl_req from virtio_scsi_handle_ctrl

To share with dataplane code.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c505333dab10cf7ffd3a30259c2df77d4d30343d
      
https://github.com/qemu/qemu/commit/c505333dab10cf7ffd3a30259c2df77d4d30343d
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Make virtio_scsi_init_req public

To share with datplane code later.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: aa8e8f83d0458a87e9a86ccfedfe68999d2d0fa6
      
https://github.com/qemu/qemu/commit/aa8e8f83d0458a87e9a86ccfedfe68999d2d0fa6
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Make virtio_scsi_free_req public

To share with dataplane code later.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 20e6dca1df6b6ea74c3d6af74dc2184f464b3035
      
https://github.com/qemu/qemu/commit/20e6dca1df6b6ea74c3d6af74dc2184f464b3035
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-23 (Tue, 23 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Make virtio_scsi_push_event public

Later this will be called by dataplane code.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 7779edfeb1822ff5f554a4c1f3e9798789a9352c
      
https://github.com/qemu/qemu/commit/7779edfeb1822ff5f554a4c1f3e9798789a9352c
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-net: use aliases instead of duplicate qdev properties

virtio-net-pci, virtio-net-s390, and virtio-net-ccw all duplicate the
qdev properties of their VirtIONet child. This approach does not work
well with string or pointer properties since we must be careful about
leaking or double-freeing them.

Use the QOM alias property to forward property accesses to the
VirtIONet child.  This way no duplication is necessary.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 6a0c6b59788627541faf70864464f1e155dc18d7
      
https://github.com/qemu/qemu/commit/6a0c6b59788627541faf70864464f1e155dc18d7
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-net: fix virtio-net child refcount in transports

object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.

The upshot of this is that we always have a refcount >= 1.  Upon hot
unplug the virtio-net child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c39343fd811a22c921fc08e9e6ca62c8e7539264
      
https://github.com/qemu/qemu/commit/c39343fd811a22c921fc08e9e6ca62c8e7539264
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio/vhost-scsi: use aliases instead of duplicate qdev properties

{virtio, vhost}-scsi-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIOSCSI/VHostSCSI child.
This approach does not work well with string or pointer
properties since we must be careful about leaking or
double-freeing them.

Use the QOM alias property to forward property accesses to the
VirtIOSCSI/VHostSCSI child. This way no duplication is necessary.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 1312f12bcc8911ed99b67227fb9d1607295f71ed
      
https://github.com/qemu/qemu/commit/1312f12bcc8911ed99b67227fb9d1607295f71ed
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports

object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.

The upshot of this is that we always have a refcount >= 1.  Upon hot
unplug the virtio-scsi/vhost-scsi child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 4f456d8025c7259c66b2b2bcec99d5c6c94d99be
      
https://github.com/qemu/qemu/commit/4f456d8025c7259c66b2b2bcec99d5c6c94d99be
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-serial: use aliases instead of duplicate qdev properties

virtio-serial-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIOSerial child.
This approach does not work well with string or pointer
properties since we must be careful about leaking or
double-freeing them.

Use the QOM alias property to forward property accesses to the
VirtIOSerial child.  This way no duplication is necessary.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: e77ca8b92af8a5213897331d676089e8919f383d
      
https://github.com/qemu/qemu/commit/e77ca8b92af8a5213897331d676089e8919f383d
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-serial: fix virtio-serial child refcount in transports

object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.

The upshot of this is that we always have a refcount >= 1.  Upon hot
unplug the virtio-serial child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 8ee486ae339f0e5236f4a9ab988fc963edcc73b5
      
https://github.com/qemu/qemu/commit/8ee486ae339f0e5236f4a9ab988fc963edcc73b5
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-rng: use aliases instead of duplicate qdev properties

virtio-rng-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIORNG child.
This approach does not work well with string or pointer
properties since we must be careful about leaking or
double-freeing them.

Use the QOM alias property to forward property accesses to the
VirtIORNG child.  This way no duplication is necessary.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 352fa88dfb2e9c72fa2a1506acb39f349d4befbf
      
https://github.com/qemu/qemu/commit/352fa88dfb2e9c72fa2a1506acb39f349d4befbf
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-rng: fix virtio-rng child refcount in transports

object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.

The upshot of this is that we always have a refcount >= 1.  Upon hot
unplug the virtio-rng child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 91ba21208839643603e7f7fa5864723c3f371ebe
      
https://github.com/qemu/qemu/commit/91ba21208839643603e7f7fa5864723c3f371ebe
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-balloon: fix virtio-balloon child refcount in transports

object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.

The upshot of this is that we always have a refcount >= 1.  Upon hot
unplug the virtio-balloon child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 48833071d955406ebeddc365a8df8b5cb12b035f
      
https://github.com/qemu/qemu/commit/48833071d955406ebeddc365a8df8b5cb12b035f
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-9p: use aliases instead of duplicate qdev properties

virtio-9p-pci all duplicate the qdev properties of their
V9fsState child. This approach does not work well with
string or pointer properties since we must be careful
about leaking or double-freeing them.

Use the QOM alias property to forward property accesses to the
V9fsState child.  This way no duplication is necessary.

Signed-off-by: Gonglei <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 8f3d60e568f53cb3ccdedd917f8e49cdb304973b
      
https://github.com/qemu/qemu/commit/8f3d60e568f53cb3ccdedd917f8e49cdb304973b
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-9p: fix virtio-9p child refcount in transports

object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is
dropped again when the property is deleted.

The upshot of this is that we always have a refcount >= 1. Upon
unplug the virtio-9p child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Gonglei <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c8075caf19b000b975349f8976958cedf7d2613a
      
https://github.com/qemu/qemu/commit/c8075caf19b000b975349f8976958cedf7d2613a
  Author: Gonglei <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio.c
    M include/hw/virtio/virtio.h

  Log Message:
  -----------
  virtio: add a wrapper for virtio-backend initialization

For better code sharing, add a helper function that handles
reference counting of the virtio backend for virtio proxy devices.

Cc: Cornelia Huck <address@hidden>
Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 19d339f11d0768df2b4e0c40530bb4ab53e6bb05
      
https://github.com/qemu/qemu/commit/19d339f11d0768df2b4e0c40530bb4ab53e6bb05
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/s390x/virtio-ccw.c
    M hw/scsi/virtio-scsi.c
    M hw/virtio/virtio-pci.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Add 'iothread' property to virtio-scsi

Similar to this property in virtio-blk for dataplane, add it as a QOM
link in virtio-scsi and an alias in virtio-scsi-pci and virtio-scsi-ccw,
in order to assign an iothread to the device.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 244e2898b7a7735b3da114c120abe206af56a167
      
https://github.com/qemu/qemu/commit/244e2898b7a7735b3da114c120abe206af56a167
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReq

Move VirtIOSCSIReq to header and add one field "vring" as a wrapper
structure of Vring, VirtIOSCSIVring.

This is necessary for coming dataplane code that runs uses vring on
iothread.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 91cb1c9b56064e7cba27ab310c9c4c477694589e
      
https://github.com/qemu/qemu/commit/91cb1c9b56064e7cba27ab310c9c4c477694589e
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/Makefile.objs
    A hw/scsi/virtio-scsi-dataplane.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi-dataplane: Code to run virtio-scsi on iothread

This implements the core part of dataplane feature of virtio-scsi.

A few fields are added in VirtIOSCSICommon to maintain the dataplane
status. These fields are managed by a new source file:
virtio-scsi-dataplane.c.

Most code in this file will run on an iothread, unless otherwise
commented as in a global mutex context, such as those functions to
start, stop and setting the iothread property.

Upon start, we set up guest/host event notifiers, in a same way as
virtio-blk does. The handlers then pop request from vring and call into
virtio-scsi.c functions to process it. So we need to make sure make all
those called functions work with iothread, too.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 63c7e542686ff9616816b527c824ec0ac1f73cbe
      
https://github.com/qemu/qemu/commit/63c7e542686ff9616816b527c824ec0ac1f73cbe
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: Hook up with dataplane

This enables the virtio-scsi-dataplane code by setting the iothread
in virtio-scsi device, and makes any function that is called by
back from dataplane to cooperate with the caller: they need to be
vring/iothread aware when handling the requests and using scsi devices
on the bus.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: dfb37cf7fa206afa6e212af16fee74427464f1d1
      
https://github.com/qemu/qemu/commit/dfb37cf7fa206afa6e212af16fee74427464f1d1
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Add migration state notifier for dataplane code

Similar to virtio-blk-dataplane, we stop the iothread while migration
starts and restart it when migration finishes.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 359eea71d98e7f2cf9efb5e65bb59a240bedb131
      
https://github.com/qemu/qemu/commit/359eea71d98e7f2cf9efb5e65bb59a240bedb131
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi-dataplane.c
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Two stages processing of cmd request

Mechanical change, in preparation for bdrv_io_plug/bdrv_io_unplug.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 1880ad4f4e3b49f15c55e816d66b9690b3ede00c
      
https://github.com/qemu/qemu/commit/1880ad4f4e3b49f15c55e816d66b9690b3ede00c
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi-dataplane.c
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Batched prepare for cmd reqs

Queue the popped requests while calling
virtio_scsi_handle_cmd_req_prepare(), then submit them after all
prepared.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 5170f40b102bcabed54e8fa8ec86957e35c41d41
      
https://github.com/qemu/qemu/commit/5170f40b102bcabed54e8fa8ec86957e35c41d41
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: Call bdrv_io_plug/bdrv_io_unplug in cmd request handling

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9786b592a93e557e575ea6f18ee1e1fc6d68dc7b
      
https://github.com/qemu/qemu/commit/9786b592a93e557e575ea6f18ee1e1fc6d68dc7b
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: Process ".iothread" property

We are ready, now let's effectively enable dataplane.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: eda470e41a753070e057380a9a71e2ad7347f667
      
https://github.com/qemu/qemu/commit/eda470e41a753070e057380a9a71e2ad7347f667
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M hw/scsi/spapr_vscsi.c
    M include/hw/scsi/scsi.h

  Log Message:
  -----------
  scsi: Drop scsi_req_abort

The only user of this function is spapr_vscsi.c. We can convert to
scsi_req_cancel plus adding a check in vscsi_request_cancelled.

Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
[Drop prototype. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 6c25fa6cf8b58db72956e880d76e4adc301bb472
      
https://github.com/qemu/qemu/commit/6c25fa6cf8b58db72956e880d76e4adc301bb472
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-generic.c

  Log Message:
  -----------
  scsi-generic: Handle canceled request in scsi_command_complete

Now that we always called the cb in bdrv_aio_cancel, let's make scsi-generic
callbacks check io_canceled flag similarly to scsi-disk.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 3df9caf88f5c0859ae380101fea47609ba1dbfbd
      
https://github.com/qemu/qemu/commit/3df9caf88f5c0859ae380101fea47609ba1dbfbd
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-disk.c
    M hw/scsi/scsi-generic.c

  Log Message:
  -----------
  scsi: Unify request unref in scsi_req_cancel

Before, scsi_req_cancel will take ownership of the canceled request and unref
it. We did this because we didn't know whether AIO CB will be called or not
during the cancelling, so we set the io_canceled flag before calling it, and
skip unref in the potentially called callbacks, which is not very nice.

Now, bdrv_aio_cancel has a stricter contract that the completion callbacks are
always called, so we can remove the checks of req->io_canceled and just unref
it in callbacks.

It will also make implementing asynchronous cancellation easier.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: a83cfd12d9868b6732e3c6e5b2cbd69a2e0ab689
      
https://github.com/qemu/qemu/commit/a83cfd12d9868b6732e3c6e5b2cbd69a2e0ab689
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M hw/scsi/scsi-disk.c
    M hw/scsi/scsi-generic.c
    M include/hw/scsi/scsi.h

  Log Message:
  -----------
  scsi: Drop SCSIReqOps.cancel_io

The only two implementations are identical to each other, with nothing specific
to device: they only call bdrv_aio_cancel with the SCSIRequest.aiocb.

Let's move it to scsi-bus.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: d5776465ee9a55815792efa34d79de240f4ffd99
      
https://github.com/qemu/qemu/commit/d5776465ee9a55815792efa34d79de240f4ffd99
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M hw/scsi/scsi-disk.c
    M hw/scsi/scsi-generic.c
    M include/hw/scsi/scsi.h

  Log Message:
  -----------
  scsi: Introduce scsi_req_cancel_complete

Let the aio cb do the clean up and notification job after scsi_req_cancel, in
preparation for asynchronous cancellation.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 8e0a9320e94930fd6e5c2906c478203b80392f5c
      
https://github.com/qemu/qemu/commit/8e0a9320e94930fd6e5c2906c478203b80392f5c
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M include/hw/scsi/scsi.h

  Log Message:
  -----------
  scsi: Introduce scsi_req_cancel_async

Devices will call this function to start an asynchronous cancellation. The
bus->info->cancel will be called after the request is canceled.

Devices will probably need to track a separate TMF request that triggers this
cancellation, and wait until the cancellation is done before completing it. So
we store a notifier list in SCSIRequest and in scsi_req_cancel_complete we
notify them.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 49e7e31aa00a9fb466203de19120fe5c4459cac0
      
https://github.com/qemu/qemu/commit/49e7e31aa00a9fb466203de19120fe5c4459cac0
  Author: Fam Zheng <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Handle TMF request cancellation asynchronously

For VIRTIO_SCSI_T_TMF_ABORT_TASK and VIRTIO_SCSI_T_TMF_ABORT_TASK_SET,
use scsi_req_cancel_async to start the cancellation.

Because each tmf command may cancel multiple requests, we need to use a
counter to track the number of remaining requests we still need to wait
for.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: be4d57c1ea7f17b9cadb0150b330efd9b6026972
      
https://github.com/qemu/qemu/commit/be4d57c1ea7f17b9cadb0150b330efd9b6026972
  Author: Peter Lieven <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M include/qemu/bitmap.h

  Log Message:
  -----------
  util: introduce bitmap_try_new

regular bitmap_new simply aborts if the memory allocation fails.
bitmap_try_new returns NULL on failure and allows for proper
error handling.

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: a9fe4c957b762dbb814c254204c082bab93c8459
      
https://github.com/qemu/qemu/commit/a9fe4c957b762dbb814c254204c082bab93c8459
  Author: Peter Lieven <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: handle failure on malloc of the allocationmap

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 1831e150606a221898bf46ffaf0453e9952cbbc4
      
https://github.com/qemu/qemu/commit/1831e150606a221898bf46ffaf0453e9952cbbc4
  Author: Peter Maydell <address@hidden>
  Date:   2014-09-30 (Tue, 30 Sep 2014)

  Changed paths:
    M block/iscsi.c
    M hw/s390x/s390-virtio-bus.c
    M hw/s390x/virtio-ccw.c
    M hw/scsi/Makefile.objs
    M hw/scsi/scsi-bus.c
    M hw/scsi/scsi-disk.c
    M hw/scsi/scsi-generic.c
    M hw/scsi/spapr_vscsi.c
    M hw/scsi/vhost-scsi.c
    A hw/scsi/virtio-scsi-dataplane.c
    M hw/scsi/virtio-scsi.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio.c
    M include/hw/scsi/scsi.h
    M include/hw/virtio/virtio-scsi.h
    M include/hw/virtio/virtio.h
    M include/qemu/bitmap.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

This update brings dataplane to virtio-scsi (NOT
yet 100% thread-safe, though, which makes it really, really
experimental.  It also brings asynchronous cancellation to
the SCSI subsystem and implements it in virtio-scsi.  This
is a pretty important feature.  Almost all the work here
was done by Fam Zheng.

I also included the virtio refcount fixes from Gonglei,
because they had a small conflict with virtio-scsi dataplane.

This pull request is using the new subkey 4E6B09D7.

# gpg: Signature made Tue 30 Sep 2014 12:31:02 BST using RSA key ID 4E6B09D7
# gpg: Good signature from "Paolo Bonzini <address@hidden>"
# gpg:                 aka "Paolo Bonzini <address@hidden>"

* remotes/bonzini/tags/for-upstream: (39 commits)
  block/iscsi: handle failure on malloc of the allocationmap
  util: introduce bitmap_try_new
  virtio-scsi: Handle TMF request cancellation asynchronously
  scsi: Introduce scsi_req_cancel_async
  scsi: Introduce scsi_req_cancel_complete
  scsi: Drop SCSIReqOps.cancel_io
  scsi: Unify request unref in scsi_req_cancel
  scsi-generic: Handle canceled request in scsi_command_complete
  scsi: Drop scsi_req_abort
  virtio-scsi: Process ".iothread" property
  virtio-scsi: Call bdrv_io_plug/bdrv_io_unplug in cmd request handling
  virtio-scsi: Batched prepare for cmd reqs
  virtio-scsi: Two stages processing of cmd request
  virtio-scsi: Add migration state notifier for dataplane code
  virtio-scsi: Hook up with dataplane
  virtio-scsi-dataplane: Code to run virtio-scsi on iothread
  virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReq
  virtio-scsi: Add 'iothread' property to virtio-scsi
  virtio: add a wrapper for virtio-backend initialization
  virtio-9p: fix virtio-9p child refcount in transports
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/7be3c1408ab7...1831e150606a

reply via email to

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