From patchwork Tue Dec 7 13:23:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 12661845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DE10C433EF for ; Tue, 7 Dec 2021 13:24:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.241091.417919 (Exim 4.92) (envelope-from ) id 1muaSV-0004LX-6X; Tue, 07 Dec 2021 13:24:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 241091.417919; Tue, 07 Dec 2021 13:24:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1muaSV-0004LQ-2i; Tue, 07 Dec 2021 13:24:39 +0000 Received: by outflank-mailman (input) for mailman id 241091; Tue, 07 Dec 2021 13:24:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1muaST-0004L1-OU for xen-devel@lists.xenproject.org; Tue, 07 Dec 2021 13:24:37 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 04fe7926-5761-11ec-a831-37629979565c; Tue, 07 Dec 2021 14:24:35 +0100 (CET) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-85-pq0CVYb0N9-a5LHy6DfeXw-1; Tue, 07 Dec 2021 08:24:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35D621B2C981; Tue, 7 Dec 2021 13:24:29 +0000 (UTC) Received: from localhost (unknown [10.39.194.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3765276612; Tue, 7 Dec 2021 13:23:37 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 04fe7926-5761-11ec-a831-37629979565c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638883474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r2isEaCd6xk+f4LxeTB/xnxK27KBL9Gzn5hEP87ohGk=; b=K9Kw4gYbiqKvwaxtXtLmibEbGmcL02Rkgllho55+fvcLfhh1hRquX+6SL7y3Tgf98cGeW2 worgxb943zmHilFavZldmtgfDOa5eYz8sXDJT5mh6g3STN3VlMLqbd7HXN3bUlLWkJ/2qI P8bRcKpwUEQlDQr5h7txQATRYwiBwZc= X-MC-Unique: pq0CVYb0N9-a5LHy6DfeXw-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Dr. David Alan Gilbert" , Julia Suvorova , "Michael S. Tsirkin" , Paolo Bonzini , Juan Quintela , xen-devel@lists.xenproject.org, Aarushi Mehta , Stefan Weil , Stefano Stabellini , Coiby Xu , "Richard W.M. Jones" , Stefano Garzarella , Kevin Wolf , Anthony Perard , Stefan Hajnoczi , Hanna Reitz , qemu-block@nongnu.org, Fam Zheng , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Paul Durrant , Ronnie Sahlberg , Peter Lieven Subject: [PATCH v3 0/6] aio-posix: split poll check from ready handler Date: Tue, 7 Dec 2021 13:23:30 +0000 Message-Id: <20211207132336.36627-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com v3: - Fixed FUSE export aio_set_fd_handler() call that I missed and double-checked for any other missing call sites using Coccinelle [Rich] v2: - Cleaned up unused return values in nvme and virtio-blk [Stefano] - Documented try_poll_mode() ready_list argument [Stefano] - Unified virtio-blk/scsi dataplane and non-dataplane virtqueue handlers [Stefano] The first patch improves AioContext's adaptive polling execution time measurement. This can result in better performance because the algorithm makes better decisions about when to poll versus when to fall back to file descriptor monitoring. The remaining patches unify the virtio-blk and virtio-scsi dataplane and non-dataplane virtqueue handlers. This became possible because the dataplane handler function now has the same function signature as the non-dataplane handler function. Stefano Garzarella prompted me to make this refactoring. Stefan Hajnoczi (6): aio-posix: split poll check from ready handler virtio: get rid of VirtIOHandleAIOOutput virtio-blk: drop unused virtio_blk_handle_vq() return value virtio-scsi: prepare virtio_scsi_handle_cmd for dataplane virtio: use ->handle_output() instead of ->handle_aio_output() virtio: unify dataplane and non-dataplane ->handle_output() include/block/aio.h | 4 +- include/hw/virtio/virtio-blk.h | 2 +- include/hw/virtio/virtio.h | 5 +- util/aio-posix.h | 1 + block/curl.c | 11 ++-- block/export/fuse.c | 4 +- block/io_uring.c | 19 ++++--- block/iscsi.c | 4 +- block/linux-aio.c | 16 +++--- block/nfs.c | 6 +-- block/nvme.c | 51 ++++++++++++------- block/ssh.c | 4 +- block/win32-aio.c | 4 +- hw/block/dataplane/virtio-blk.c | 16 +----- hw/block/virtio-blk.c | 14 ++---- hw/scsi/virtio-scsi-dataplane.c | 60 +++------------------- hw/scsi/virtio-scsi.c | 2 +- hw/virtio/virtio.c | 73 +++++++++------------------ hw/xen/xen-bus.c | 6 +-- io/channel-command.c | 6 ++- io/channel-file.c | 3 +- io/channel-socket.c | 3 +- migration/rdma.c | 8 +-- tests/unit/test-aio.c | 4 +- util/aio-posix.c | 89 +++++++++++++++++++++++++-------- util/aio-win32.c | 4 +- util/async.c | 10 +++- util/main-loop.c | 4 +- util/qemu-coroutine-io.c | 5 +- util/vhost-user-server.c | 11 ++-- 30 files changed, 219 insertions(+), 230 deletions(-) Reviewed-by: Stefano Garzarella