qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 0/7] virtio-scsi: Asynchronous cancellation
@ 2014-09-30  3:40 Fam Zheng
  2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 1/7] scsi: Drop scsi_req_abort Fam Zheng
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Fam Zheng @ 2014-09-30  3:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini

v5: Squash in Paolo's suggested patch into patch 7, fixed "notifier->tmf_req"
    and did some test.

v4: Call notifier_list_notify in scsi_req_complete. (Paolo)

v3: Address Paolo's comments:
    - scsi_req_canceled -> scsi_req_cancel_complete
    - Drop unnecessary changes in scsi_req_alloc and scsi_req_unref.
    - Update comment of scsi_req_cancel_async.
    - Add notifier only if not null.
    - Use slice allocator for VirtIOSCSICancelNotifier and
      VirtIOSCSICancelTracker.
    - Use int return value (0/-EINPROGRESS) for virtio_scsi_do_tmf.

This series changes VIRTIO_SCSI_T_TMF_ABORT_TASK and
VIRTIO_SCSI_T_TMF_ABORT_TASK_SET emulation to asynchronous by making use of
bdrv_aio_cancel_async.

Before, when guest cancels a SCSI command, we use a nested poll loop to wait
until the request is cancelled or completed before returning. This blocks the
whole vm and makes the guest unresponsive if the backend block device takes
time to complete it, possibly because of slow IO, throttling, network issue,
etc..

Now we return to the guest to allow vcpus to run before completing the TMF, and
only after all the requests have been canceled, we notify the guest about the
completing of the TMF command.


Fam Zheng (7):
  scsi: Drop scsi_req_abort
  scsi-generic: Handle canceled request in scsi_command_complete
  scsi-bus: Unify request unref in scsi_req_cancel
  scsi: Drop SCSIReqOps.cancel_io
  scsi: Introduce scsi_req_cancel_complete
  scsi: Introduce scsi_req_cancel_async
  virtio-scsi: Handle TMF request cancellation asynchronously

 hw/scsi/scsi-bus.c              | 43 ++++++++++++++++++---------
 hw/scsi/scsi-disk.c             | 59 +++++++++++--------------------------
 hw/scsi/scsi-generic.c          | 37 ++++++------------------
 hw/scsi/spapr_vscsi.c           | 11 +++++--
 hw/scsi/virtio-scsi.c           | 64 ++++++++++++++++++++++++++++++++++++-----
 include/hw/scsi/scsi.h          |  5 +++-
 include/hw/virtio/virtio-scsi.h | 10 +++++--
 7 files changed, 132 insertions(+), 97 deletions(-)

-- 
1.9.3

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

end of thread, other threads:[~2014-09-30  8:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  3:40 [Qemu-devel] [PATCH v5 0/7] virtio-scsi: Asynchronous cancellation Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 1/7] scsi: Drop scsi_req_abort Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 2/7] scsi-generic: Handle canceled request in scsi_command_complete Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 3/7] scsi-bus: Unify request unref in scsi_req_cancel Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 4/7] scsi: Drop SCSIReqOps.cancel_io Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 5/7] scsi: Introduce scsi_req_cancel_complete Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 6/7] scsi: Introduce scsi_req_cancel_async Fam Zheng
2014-09-30  3:40 ` [Qemu-devel] [PATCH v5 7/7] virtio-scsi: Handle TMF request cancellation asynchronously Fam Zheng
2014-09-30  8:44   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).