From patchwork Thu Dec 2 15:33:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 12652859 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 1D281C433F5 for ; Thu, 2 Dec 2021 15:35:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.236784.410660 (Exim 4.92) (envelope-from ) id 1mso6x-0004Gr-J6; Thu, 02 Dec 2021 15:35:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 236784.410660; Thu, 02 Dec 2021 15:35:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mso6x-0004Gk-FR; Thu, 02 Dec 2021 15:35:03 +0000 Received: by outflank-mailman (input) for mailman id 236784; Thu, 02 Dec 2021 15:35:02 +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 1mso6v-0004Ge-Pi for xen-devel@lists.xenproject.org; Thu, 02 Dec 2021 15:35:01 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 68e0e18e-5385-11ec-b1df-f38ee3fbfdf7; Thu, 02 Dec 2021 16:35:00 +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-302-kk7Y1t1INsiyPM8LKA2YiQ-1; Thu, 02 Dec 2021 10:34:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7FF271023F4E; Thu, 2 Dec 2021 15:34:53 +0000 (UTC) Received: from localhost (unknown [10.39.193.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AFE419D9F; Thu, 2 Dec 2021 15:34:03 +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: 68e0e18e-5385-11ec-b1df-f38ee3fbfdf7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638459299; 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=2kPW/C5/FL+h8BxSzNJZWzt3equt7yVQ9UPJp6j/x58=; b=Wwak2csQW5q2elDf7AG25mDMH3hG/pB74aXnHKxS4Ud/FW3DCb3m11Wxf/IKwNWjoTnZ1f fhcVdMB2ZdxAxijfzVcD5OqSeUX/ALG3Jk/rkQVW5eZ9Y7GSKBd/ES+QxnLN7aBJq1XcRJ 5m61EvyNd+2cqKLU0PTnMHhfeJhJr8A= X-MC-Unique: kk7Y1t1INsiyPM8LKA2YiQ-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Hanna Reitz , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefan Hajnoczi , Kevin Wolf , "Richard W.M. Jones" , Stefano Garzarella , Paolo Bonzini , Aarushi Mehta , Ronnie Sahlberg , "Michael S. Tsirkin" , Julia Suvorova , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Anthony Perard , Paul Durrant , Coiby Xu , qemu-block@nongnu.org, "Dr. David Alan Gilbert" , xen-devel@lists.xenproject.org, Stefan Weil , Fam Zheng , Stefano Stabellini , Peter Lieven Subject: [PATCH v2 0/6] aio-posix: split poll check from ready handler Date: Thu, 2 Dec 2021 15:33:56 +0000 Message-Id: <20211202153402.604951-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 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/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 ++-- 29 files changed, 217 insertions(+), 228 deletions(-)