From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWkSq-0008Ft-5f for qemu-devel@nongnu.org; Wed, 24 Sep 2014 07:10:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWkSg-0003KW-QB for qemu-devel@nongnu.org; Wed, 24 Sep 2014 07:10:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWkSg-0003KA-Gh for qemu-devel@nongnu.org; Wed, 24 Sep 2014 07:10:18 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8OBACAW004052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 24 Sep 2014 07:10:13 -0400 Message-ID: <5422A690.2020904@redhat.com> Date: Wed, 24 Sep 2014 13:10:08 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411547278-25915-1-git-send-email-famz@redhat.com> In-Reply-To: <1411547278-25915-1-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/7] virtio-scsi: Asynchronous cancellation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi Il 24/09/2014 10:27, Fam Zheng ha scritto: > v2: Address Paolo's comments: > - Drop scsi_req_abort. > - Split patch 1. > - Use NotifierList. > - Track the number of cancelled requests in virtio-scsi. > > 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_canceled > scsi: Introduce scsi_req_cancel_async > virtio-scsi: Handle TMF request cancellation asynchronously > > hw/scsi/scsi-bus.c | 48 +++++++++++++++++++---------- > hw/scsi/scsi-disk.c | 59 ++++++++++------------------------- > hw/scsi/scsi-generic.c | 37 ++++++---------------- > hw/scsi/spapr_vscsi.c | 11 +++++-- > hw/scsi/virtio-scsi.c | 84 +++++++++++++++++++++++++++++++++++++++++++++----- > include/hw/scsi/scsi.h | 5 ++- > 6 files changed, 146 insertions(+), 98 deletions(-) > I didn't review 5-7 yet, and they are more complicated so I'll start by applying the nice cleanup part (1-4). Thanks! Paolo