From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XURac-0004A2-3C for qemu-devel@nongnu.org; Wed, 17 Sep 2014 22:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XURaV-0003vY-RS for qemu-devel@nongnu.org; Wed, 17 Sep 2014 22:36:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XURaV-0003uc-K9 for qemu-devel@nongnu.org; Wed, 17 Sep 2014 22:36:51 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8I2aj4G028875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 17 Sep 2014 22:36:45 -0400 From: Fam Zheng Date: Thu, 18 Sep 2014 10:36:36 +0800 Message-Id: <1411007799-23199-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] virtio-scsi: Asynchronous cancellation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi 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 (3): scsi-bus: Unify request unref in scsi_req_cancel scsi: Introduce scsi_req_cancel_async virtio-scsi: Handle TMF request cancellation asynchronously hw/scsi/scsi-bus.c | 78 +++++++++++++++++++++++++++++++++++++++----------- hw/scsi/scsi-disk.c | 59 +++++++++++--------------------------- hw/scsi/scsi-generic.c | 28 ++++-------------- hw/scsi/virtio-scsi.c | 45 ++++++++++++++++++++++++----- include/hw/scsi/scsi.h | 16 ++++++++++- 5 files changed, 136 insertions(+), 90 deletions(-) -- 1.9.3