From patchwork Mon Jul 29 15:16:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aarushi Mehta X-Patchwork-Id: 11064045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97D9A1398 for ; Mon, 29 Jul 2019 15:27:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 883D028249 for ; Mon, 29 Jul 2019 15:27:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BEE02864E; Mon, 29 Jul 2019 15:27:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1522328249 for ; Mon, 29 Jul 2019 15:27:39 +0000 (UTC) Received: from localhost ([::1]:53916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7Yo-0001pZ-Fy for patchwork-qemu-devel@patchwork.kernel.org; Mon, 29 Jul 2019 11:27:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43443) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7P1-0005xw-KE for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:17:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs7P0-0006cU-BN for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:17:31 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:34289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hs7P0-0006a6-3g; Mon, 29 Jul 2019 11:17:30 -0400 Received: by mail-pf1-x442.google.com with SMTP id b13so28202104pfo.1; Mon, 29 Jul 2019 08:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gqQiGoFiW+lpg1rPNQrONW25rfL/th38heAefJfZSA0=; b=r6GZm5KCfz/8cRyF6cB9GrZDQq+FyFDfB9wrezlcGFoBEHyRTytxJVaVF1acbCcDFI BRJJYPJYfvpZi7SRfv4N5z7zjieObjYUD+UXWse9IaNIIAUvKicNKLPS3DNo6Q/HDAmo b3aliuLb1iT3TIEkIpOZ7teSUx+YWo5+UEgB/2m+0xb8cZ5y8kGaS3D0uXmK9sdg0pHX XeZwH0/2K9FevNN3kxKeThPQgUoVLFeENmtQfvfpGFBGFVAha5SQrYEcMd/DNWxwA3VD QyxiI0dVbdJqVL4qcm5jMOAi/sRN3ppZI5qAEGDTg4FoKOeJurlhdBUxhkMlL3rKJAVq QuLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gqQiGoFiW+lpg1rPNQrONW25rfL/th38heAefJfZSA0=; b=Ix7ALbqXPF3WUxGtuw1AM37B5C3DlsgCYRQ61tZ7M2pnDFc0EqgBfDdydDW36aQRQu KhkEiWdpoeWRJZM6sKVL9NKb2vr/ppGJudn0zcdjAu9tcraWmmXAAoWzVYHpuq0gIizA X3uNbS8pnIGzL9VHuGT1+SWqQIyGTFwcvVRnY8HSIFSFfLewuiS9w8NDvY57GMQfUO39 j+RRNuKns2SgYOoDf/IUFGUh0ezWfmJ7RcRJdiStPtrsx49pJnLGhimM45/KgB6McpoC 8vHw+6hizVrgwo+nsvr0BuNtAJ1nMhOZZwchByrl+5yNlTv1qyeHCrcvUtoH8xvXOWH0 eMVg== X-Gm-Message-State: APjAAAXvHprmRsopZl9oZfsimd9Gv5uKUsQQXNRQ6xdxBgGJSzilowa2 mUdxtWW2jUwubzMxQ6us71ktqg5Tj2s= X-Google-Smtp-Source: APXvYqyW30VE9bwSRhhVu+0I2Dl7pkW2zI0Tik3a3GfsfcLgkyXKaUQAi7Ogqlj+yq4NolaBEDKy+g== X-Received: by 2002:a63:590f:: with SMTP id n15mr58185179pgb.190.1564413448228; Mon, 29 Jul 2019 08:17:28 -0700 (PDT) Received: from localhost.localdomain ([136.233.9.97]) by smtp.gmail.com with ESMTPSA id h129sm58693941pfb.110.2019.07.29.08.17.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 08:17:27 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 20:46:36 +0530 Message-Id: <20190729151651.21306-1-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH v7 00/15] Add support for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Sergio Lopez , Markus Armbruster , Maxim Levitsky , saket.sinha89@gmail.com, Max Reitz , Stefan Hajnoczi , Paolo Bonzini , Stefan Hajnoczi , Julia Suvorova , Aarushi Mehta Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch series adds support for the newly developed io_uring Linux AIO interface. Linux io_uring is faster than Linux's AIO asynchronous I/O code, offers efficient buffered asynchronous I/O support, the ability to do I/O without performing a system call via polled I/O, and other efficiency enhancements. Testing it requires a host kernel (5.1+) and the liburing library. Use the option -drive aio=io_uring to enable it. Benchmarks for the system at https://github.com/rooshm/benchmarks io_uring has similar performance as libaio but supports cache=writeback. Further performance enhancement will be implemented There is currently an -EIO output when guests are booted from io_uring on ext4, the error is reported upstream. https://lore.kernel.org/linux-block/20190723080701.GA3198@stefanha-x1.localdomain/ v7: - completes io-tests options - misc fixes v6: - add slow path for short-read - hooks up fsync - enables qemu-iotests with aio options - adds bdrv_parse_aio v5: - Adds completion polling - Extends qemu-io - Adds qemu-iotest v4: - Add error handling - Add trace events - Remove aio submission based code Aarushi Mehta (15): configure: permit use of io_uring qapi/block-core: add option for io_uring block/block: add BDRV flag for io_uring block/io_uring: implements interfaces for io_uring stubs: add stubs for io_uring interface util/async: add aio interfaces for io_uring blockdev: adds bdrv_parse_aio to use io_uring block/file-posix.c: extend to use io_uring block: add trace events for io_uring block/io_uring: adds userspace completion polling qemu-io: adds option to use aio engine qemu-img: adds option to use aio engine for benchmarking qemu-nbd: adds option for aio engines tests/qemu-iotests: enable testing with aio options tests/qemu-iotests: use AIOMODE with various tests MAINTAINERS | 8 + block.c | 22 ++ block/Makefile.objs | 3 + block/file-posix.c | 99 ++++++-- block/io_uring.c | 439 ++++++++++++++++++++++++++++++++++ block/trace-events | 12 + blockdev.c | 12 +- configure | 27 +++ include/block/aio.h | 16 +- include/block/block.h | 2 + include/block/raw-aio.h | 12 + qapi/block-core.json | 4 +- qemu-img.c | 10 +- qemu-img.texi | 5 +- qemu-io.c | 24 +- qemu-nbd.c | 12 +- qemu-nbd.texi | 4 +- stubs/Makefile.objs | 1 + stubs/io_uring.c | 32 +++ tests/qemu-iotests/028 | 3 +- tests/qemu-iotests/058 | 2 +- tests/qemu-iotests/089 | 4 +- tests/qemu-iotests/091 | 7 +- tests/qemu-iotests/109 | 3 +- tests/qemu-iotests/147 | 5 +- tests/qemu-iotests/181 | 10 +- tests/qemu-iotests/183 | 7 +- tests/qemu-iotests/185 | 17 +- tests/qemu-iotests/200 | 3 +- tests/qemu-iotests/201 | 10 +- tests/qemu-iotests/check | 15 +- tests/qemu-iotests/common.rc | 14 ++ tests/qemu-iotests/iotests.py | 9 +- util/async.c | 36 +++ 34 files changed, 812 insertions(+), 77 deletions(-) create mode 100644 block/io_uring.c create mode 100644 stubs/io_uring.c