From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483432; cv=none; d=zoho.com; s=zohoarc; b=FlvGKzfQk/Hr1c4lpEQVKXJAp1SMfGbbonU/MeazuF/C+20wN0tEBBz2mf8biGNhk6P17dIR/LEjqgsGmiTozCopqmvvRt4/nB4BKoJipKsE87GvnRKYHVbBDi8ZGyrVt/J0XjzR1Kna/4nxsp8GuV3ROeinbmGTzHRgxVYbOCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483432; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Q+Kzz8YvgmccQoubOgUbAFtVK8kRATQnmKwd+TXQuz4=; b=m5hVzK/F/Bd1kAFAdSKbsbmWbJQQM3Pgz6H9eEd+fBBdnwXw2Lmyqh4f11q5DvhdY6Wa9nVo184EEGsxavsRhMu1mAH5+hyhDIwBOaghMw3W78FNn5XcV3fr8SP3QR0mgJqjPbYguZKTt7QoHwrX4H8+nCtw0H7Teharnd/V5jU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483432152985.2353845079497; Tue, 21 May 2019 17:03:52 -0700 (PDT) Received: from localhost ([127.0.0.1]:32949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEjR-0003d9-6u for importer@patchew.org; Tue, 21 May 2019 20:03:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcZ-0005oR-Qk for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYe-0001ba-AJ for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:37 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:37052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYe-0001az-52; Tue, 21 May 2019 19:52:36 -0400 Received: by mail-pg1-x544.google.com with SMTP id n27so311543pgm.4; Tue, 21 May 2019 16:52:36 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:34 -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:in-reply-to:references; bh=Q+Kzz8YvgmccQoubOgUbAFtVK8kRATQnmKwd+TXQuz4=; b=MhGUjGjl8RHNjBLycf3ZmHZzYcMobB711qKUAwC1k60LCuS2IuvcIxejJ1SlxJCnGT tdrfZsGBmUlR93hdsqHytG3eJIL+mL9YnInLIJdfKddEiHeXVgFPA/B+GUqllTG5Gb7v /q1b9lQnuEwYlMjP8vfC17zN6zhegfNUve3rK0z2H6BfGVNp5e0a8WL5rcHSdEYqZnqi GgiPLd0+//Im49o9J+Vc8mSwctr5w8fe2Y3PBaAFnesXQ3R21RHP/iVylv0+OQEIkEq4 x2nqbMtiZRnH49s0XJAIDuhfVBuy2BTuX0VKYmk4PqDtL12ZbRsM2r/hrvCLSkwHWZW6 MEUg== 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:in-reply-to :references; bh=Q+Kzz8YvgmccQoubOgUbAFtVK8kRATQnmKwd+TXQuz4=; b=S5IZScAuzUPBSKsXotoXEtkOjn9ivw8GmI1se/KexIAxiKB16I84gm2llWz/yofeE1 nRL8LO6FZTH6jXTCabgwYqLWPPs5pHsNau33o1vAIjsH17504OvvwsPHEWDitt3YvNyH qJk9M8l6QtoOyVxylqfjUbED36ulkQrNy6c+jBfnlxPiOt6DdB383ZijPPWiMvOTW9K4 BNDCJ3OUjlYIFP+5Xc8sEr17xnu2+OLpp32RDn/t9hj4NGSNakv7jZCS71TqVR5d3GVd 7L38vBZL+ofNj6EdQ8USFuBvzpbxUOpNh42rhOrFSzzwZP61hDShGG0y+xiwWzDMOVWR Z3aQ== X-Gm-Message-State: APjAAAVHrso52KGMg/DPim6Ewb4k4OlpH632YSsiQBO5Dn3elke0w9gC l63ixamD51RZOAI78DTv3qgInwGHHELtJw== X-Google-Smtp-Source: APXvYqxY2Zeiq0+y9ddZskZfS3muhFWgR8gZjsLgifKPMczF8maiAQmDh3CamNxioaxHP7DESdh80Q== X-Received: by 2002:a62:4ed8:: with SMTP id c207mr92654835pfb.241.1558482754777; Tue, 21 May 2019 16:52:34 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:07 +0530 Message-Id: <20190521235215.31341-2-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [RFC PATCH 1/9] qapi/block-core: add option for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- qapi/block-core.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 7ccbfff9d0..116995810a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2776,11 +2776,12 @@ # # @threads: Use qemu's thread pool # @native: Use native AIO backend (only Linux and Windows) +# @io_uring: Use linux io_uring # # Since: 2.9 ## { 'enum': 'BlockdevAioOptions', - 'data': [ 'threads', 'native' ] } + 'data': [ 'threads', 'native','io_uring' ] } ## # @BlockdevCacheOptions: -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483520; cv=none; d=zoho.com; s=zohoarc; b=fcJsH9/A8Q38sqGVG5Jim/eGd0Xe63ht5IHsv9CEfwM8ZBeyEQvAdhthZjy1SeuEe3LMbsb1N1dmxsQ5Mf1vyB2yRBQS2WWGmzrjD5kBWhitGEG/kKpaWUE1Vkw3zcSiW7PMr5vCGfbUIRt8fMh/KcNUaGnMWWM4JUjDxF9E79w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483520; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=LRaFFcCz9V1QD7Nw7bkLXRkuVZNJbVer9JVm4TimWgA=; b=WrQIjHYfsHDrBcUxS209xiZMpA2K33dyHJoDoFjaVcAzeWvBVco96iIl73M9sAwI2DKWT+Dom2r0RVjAaEa6ULJ9ir7LDrn/IuXUrzth5PP6U6G1xkOnpIr4zn6h9WBvwe90TkBtQorvWrPT35zS+Rw2w2clNRP9dC8JX/pTcyY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483520918997.4797171137773; Tue, 21 May 2019 17:05:20 -0700 (PDT) Received: from localhost ([127.0.0.1]:32979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEks-0004Xk-TJ for importer@patchew.org; Tue, 21 May 2019 20:05:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcY-0005oR-PU for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYh-0001dK-SJ for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:40 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:34646) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYh-0001d3-NJ; Tue, 21 May 2019 19:52:39 -0400 Received: by mail-pl1-x642.google.com with SMTP id w7so126757plz.1; Tue, 21 May 2019 16:52:39 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:37 -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:in-reply-to:references; bh=LRaFFcCz9V1QD7Nw7bkLXRkuVZNJbVer9JVm4TimWgA=; b=VwWIgeZZ5/MBtJzQLdxtn3PXnbPFJErvmovMXIa3p+4NLl+UoNdFQA09LLD2b15toS fzqAVo4YydOomMNzWjJ+6gY/usO4+Lq2T/Fcwy7jksdsb2h29+66DCpvHBRRKwpBrxSM 1moMbCaRWfUOzoepTqeYhWe/nGIwHGc8pKg1XKSOXUk3ZQKWmM2E+6Kv9yQ4JO0xSVpf FrU3f+ezPeWCJKK8F9AdUZGs0sElNcFrS7rShuq77xFCDnqRWI03/wyvUYEwy0HZ6yBq LowRfKszjcnq2QjbPpXCVfiiGVUdENDIRR0bnnNTOMJquD0Yf5s/8HJLH/CW7lf8bsHU yaeg== 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:in-reply-to :references; bh=LRaFFcCz9V1QD7Nw7bkLXRkuVZNJbVer9JVm4TimWgA=; b=TGOl+nfj1S0LbqqSS+nbM4bJoYjY05GUa+//5s7VdaTvj+gOjyWTFPOqEYN2mw6d6S HtiCGdR9fhIeO/5Pbe+xuDu3/r/LUxzPBc2F+OgViYIJHJ5ZSD91ZS3sNX8yMzFL+2+8 LDcfp/Ss2p94AOb0991KZnhg3yXMhk017rguVYVemqy/QHaj5QwbwZcI9xTtmZEDD6tY nNkELdZ9aub8ZILKM8Ooq1Fs7g3QfFBGpsqkyDISL2n7Kh7gyUJtADQmnvtUVC6iBM9y Axa6a91s79tZ3PR5qYSdZGeFxnYa4EgxmpVRZbOaYpDxgwcSRUXcBQTyKQeTN1ytlPhm el9Q== X-Gm-Message-State: APjAAAX0b60dRAbTLayIu0ekZyW3ksTTFIgYFNm76N9wZh/WJFARTn50 x8KElrXxZrOLJm23oY3Gyz9hmFKXeoAJKQ== X-Google-Smtp-Source: APXvYqyOyqWnuEqrtisT0T3c3nnK2ripmJWOfs4A2qm+YS8dQQPJAlD+fFXGn/sp7Z3/oX+Pr/x4OQ== X-Received: by 2002:a17:902:b094:: with SMTP id p20mr63128698plr.164.1558482758299; Tue, 21 May 2019 16:52:38 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:08 +0530 Message-Id: <20190521235215.31341-3-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [RFC PATCH 2/9] block/block: add BDRV flag for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- include/block/block.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/block/block.h b/include/block/block.h index 5e2b98b0ee..005f42b133 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -121,6 +121,7 @@ typedef struct HDGeometry { ignoring the format layer */ #define BDRV_O_NO_IO 0x10000 /* don't initialize for I/O */ #define BDRV_O_AUTO_RDONLY 0x20000 /* degrade to read-only if opening read= -write fails */ +#define BDRV_O_IO_URING 0x40000 /* use io_uring instead of the thread p= ool */ #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_NO_FLUSH) -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483430; cv=none; d=zoho.com; s=zohoarc; b=eGk+ngOw86DepmFLUgRaZJ5ACTFw7T7/u+0ndxikvEO34IPJU8uwXsSTDd/y11nJnQ7ZUqPfjXi26ozW6bqgOfHSV8HTr0VTaXDJMgT7belt6O5DaMSMgaA57apDKRKuAX0k5gzs76PQxithfnmzqDYaJh4KzgbLh9ls0KUKBt0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483430; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=u+flvTgxCSEnbGBAPAYORRxauVugPBlncOQJBlabvsk=; b=X3zhDU1lsllmS0HYFJtnu6ymR2V0feNP8UKhiHGWPQSxjZ7szKHx9TsOMWboxgMY3FnkY+SHGc4sZ1dpT3r8JB3L+rPeh/kK3kyoECosG1KaCMhTNv4RS747Nn0jYiyyEdjpyQCx0UHsGtX+PwTREjKrh/WbHQZDnzbMBZYRQxA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483430842419.9793660940609; Tue, 21 May 2019 17:03:50 -0700 (PDT) Received: from localhost ([127.0.0.1]:32947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEjM-0003a7-Ru for importer@patchew.org; Tue, 21 May 2019 20:03:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcX-0005iQ-SR for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYl-0001f4-AO for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:44 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:42288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYl-0001en-5G; Tue, 21 May 2019 19:52:43 -0400 Received: by mail-pf1-x441.google.com with SMTP id 13so267742pfw.9; Tue, 21 May 2019 16:52:43 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:41 -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:in-reply-to:references; bh=u+flvTgxCSEnbGBAPAYORRxauVugPBlncOQJBlabvsk=; b=EGTJ4KygxPfOKSU16lqWxY8l83cPOLjgZ1SbYKLcfA1U7ZrOLAuqaljRWQrKCXfJOh x/hTk+H8nUPd1j9HgMRolFr/cX/2jRLEzrMpPG/1H02CQzYPeQgs4tAU/UXhL33iLxbX paq2P4RoqomyHLa7Xa0WU2PgYttubz6HXIcNo3/ArweaiMAZ+bEkAzuMbRm/ydMGc9ku Hkeqe438yyhu7ehjNCw6J9dk5vdr2n6gXwEOdlnuRENcnmbPHVZ2+tF8i2yRqLxC5odU IPTiXJhHPk7CkIBl1rNad96pPEsB1+2NJLORSuC5THHFduSQvxMgyd/NCSDptH4VW5I8 19Sg== 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:in-reply-to :references; bh=u+flvTgxCSEnbGBAPAYORRxauVugPBlncOQJBlabvsk=; b=s+rhbiGca15HsH3y8GaoVmxc+653AOrzqizncw0SCKLoTZeXw9uuocQL2/sM9ImDiO cxKKmclKvVdfnV7Hj9hIUfES1KQWGXkRJCVQ55tfr/Ee9o8PnBS87+g/7Mwt0PlDYf/8 IX5w4tHCvDUYnXjuYfC8iP9TxsElGv611JSEKsEng3DIyvxe7lKLs5iVoBIVowPf1zlJ n8eJZVlFvAUUhHSTCasUoBXUpsKFLgvA2SeRSnV3D/0jeHMWd+ipfOh3fDSTyggV/8tj N0QqORKfOYgdIdz8eGHB7tcqpDZLoE/hfPxCX/aqIW0DI9OZCaO8cTm4+HeOpYf4pzbn u51g== X-Gm-Message-State: APjAAAWCo+UyzP2xeEXCwvcc1xyZuqiGhEYMK1qz8maAZOmbzORnasxt T9D+VRo/Hq1C1ptUh7FAccNanf1ATDMiFw== X-Google-Smtp-Source: APXvYqwqWyjoLHnK34cWpnbSnqkY5qobLwOip2Ucb3kTehPjM8JwAP5414Vv1BxmATUTMpZE5vSlfQ== X-Received: by 2002:a63:d343:: with SMTP id u3mr85966342pgi.285.1558482761861; Tue, 21 May 2019 16:52:41 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:09 +0530 Message-Id: <20190521235215.31341-4-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [RFC PATCH 3/9] include/block: declare interfaces for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- include/block/aio.h | 16 +++++++++++++++- include/block/raw-aio.h | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/block/aio.h b/include/block/aio.h index 0ca25dfec6..2f9acbcd7d 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -50,6 +50,7 @@ typedef void IOHandler(void *opaque); struct Coroutine; struct ThreadPool; struct LinuxAioState; +struct LuringState; struct AioContext { GSource source; @@ -118,11 +119,19 @@ struct AioContext { struct ThreadPool *thread_pool; #ifdef CONFIG_LINUX_AIO - /* State for native Linux AIO. Uses aio_context_acquire/release for + /* + * State for native Linux AIO. Uses aio_context_acquire/release for * locking. */ struct LinuxAioState *linux_aio; #endif +#ifdef CONFIG_LINUX_IO_URING + /* + * State for native Linux AIO. Uses aio_context_acquire/release for + * locking. + */ + struct LuringState *linux_io_uring; +#endif /* TimerLists for calling timers - one per clock type. Has its own * locking. @@ -387,6 +396,11 @@ struct LinuxAioState *aio_setup_linux_aio(AioContext *= ctx, Error **errp); /* Return the LinuxAioState bound to this AioContext */ struct LinuxAioState *aio_get_linux_aio(AioContext *ctx); +/* Setup the LuringState bound to this AioContext */ +struct LuringState *aio_setup_linux_io_uring(AioContext *ctx, Error **errp= ); + +/* Return the LuringState bound to this AioContext */ +struct LuringState *aio_get_linux_io_uring(AioContext *ctx); /** * aio_timer_new_with_attrs: * @ctx: the aio context diff --git a/include/block/raw-aio.h b/include/block/raw-aio.h index ba223dd1f1..2e413bbee0 100644 --- a/include/block/raw-aio.h +++ b/include/block/raw-aio.h @@ -58,6 +58,21 @@ void laio_attach_aio_context(LinuxAioState *s, AioContex= t *new_context); void laio_io_plug(BlockDriverState *bs, LinuxAioState *s); void laio_io_unplug(BlockDriverState *bs, LinuxAioState *s); #endif +/* io_uring.c - Linux io_uring implementation */ +#ifdef CONFIG_LINUX_IO_URING +typedef struct LuringState LuringState; +LuringState *luring_init(Error **errp); +void luring_cleanup(LuringState *s); +int coroutine_fn luring_co_submit(BlockDriverState *bs, LuringState *s, in= t fd, + uint64_t offset, QEMUIOVector *qiov, int t= ype); +BlockAIOCB *luring_submit(BlockDriverState *bs, LuringState *s, int fd, + int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + BlockCompletionFunc *cb, void *opaque, int type); +void luring_detach_aio_context(LuringState *s, AioContext *old_context); +void luring_attach_aio_context(LuringState *s, AioContext *new_context); +void luring_io_plug(BlockDriverState *bs, LuringState *s); +void luring_io_unplug(BlockDriverState *bs, LuringState *s); +#endif #ifdef _WIN32 typedef struct QEMUWin32AIOState QEMUWin32AIOState; -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483325; cv=none; d=zoho.com; s=zohoarc; b=IxexFGoPC068cnAlHUCOcWbrem7jijF9l+ooYI1KhV+kwyd8q0z/JTfiioCt3q2KEBvOD2fWojmk9Tog/X7QEEI4EwkC3OEx5aV9iH6rDtiHS9ehf7K52BLkAupeFvjaxR/zg02AUS+0QjKK2Eg/3279RO/BtPMkU4qvoyWI90g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483325; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6t8EyasZJmDI3dL3/CDwbkFcNJeDBde1hDDWAyb831A=; b=cSq2v5Bsjf6qk8Eramy5z9EMjj1I6kvKFhQRNfJ0IfwmrjnfNUPUNwQ5htxgd5NO9zXBLt43QY5ITq5hP8RlTquDwgTuXAJ2kYMivKBs/FOG2u3enjuYuPwnWzQWzYiTT03CMgYZPONNk0NuLj3vbEtzYVoBhiruRmOGGnFMu7E= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483325242581.8469892233716; Tue, 21 May 2019 17:02:05 -0700 (PDT) Received: from localhost ([127.0.0.1]:32910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEhF-0001KU-UF for importer@patchew.org; Tue, 21 May 2019 20:01:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcW-0005iQ-QI for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYp-0001hC-1O for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:47 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYo-0001gr-S8; Tue, 21 May 2019 19:52:46 -0400 Received: by mail-pf1-x444.google.com with SMTP id q17so271533pfq.8; Tue, 21 May 2019 16:52:46 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:44 -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:in-reply-to:references; bh=6t8EyasZJmDI3dL3/CDwbkFcNJeDBde1hDDWAyb831A=; b=jHqgYbzD0MLSWwn80XgJA6ozg3JiiVqBcEWYyvc6jD/nKXFdSM0ZmmKAQtTfQ+ruY/ gRloWm2VCuN0fpdd7IRqO28eXccV0RYyNjw6DRkbAE3qpq64Svfy8CbZ0PkRyA8mE6Pd Xg36g1kdMnlSFyx0niyoZ2LvvFuJJUL9v62H1ZvrfOS59FBi2lmrzPUx+ZsoKiClwCr6 dObbxYt/1VXqu/vkJ1F59oF65a410U5Y7cV1hQ4B6uF8a/ChLFLZuh4Aa84OZF6bCVaT wy/QTq0VbP5/utrXh+HpMuApuVSyX9GRaM1++wssj38xsYcQ5Rpl+CYii8PMIllH2dcL vekA== 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:in-reply-to :references; bh=6t8EyasZJmDI3dL3/CDwbkFcNJeDBde1hDDWAyb831A=; b=r2vsYhAneTGPCx+iqGRzghZBLY+omng7aRTHBbEWsWh+hy4ZII+8/n8MVELQH8srJG Tf1OVsI3ioFhzv/Q44UAVjJssduf0Ml0Q5AaUtk6f8v1f7w4MI/LQyI89NErgNEuS98a Qj6+c2ed/Pg+F94GnCvQqOf41yqTwRT6SUi0fgxmZpEN0lzcINi+vQMaqmORJivfUK6T DABjvwuIPVRmtWLGycKsvRO6oAimEaW2Dk6SO2kcFlwv4DhJ+ioOf7fqGUQ6nGyEANlP HnnsIt8MXJtOq29TugY/2LRirarOVU9XsyyuPUnHC35DoVOWGPehBnfvDdqe38He05ZC mbSg== X-Gm-Message-State: APjAAAXdkLjFw9EbiiNtifLm/amrUBFKfnWO1vSARIgI6E+yAOR+HUhi +fWlVr7XCGmqAN5sPqcGTeb+ZxcbeHVx8g== X-Google-Smtp-Source: APXvYqzrWBbsbCPMPl8mF11WMCnG1LHB+X9TVBJWdz50dtDDFoaii6bdMnVOKj8nr5x7IjOut+eqVQ== X-Received: by 2002:a62:6dc6:: with SMTP id i189mr91080963pfc.155.1558482765576; Tue, 21 May 2019 16:52:45 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:10 +0530 Message-Id: <20190521235215.31341-5-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [RFC PATCH 4/9] stubs: add aio interface stubs for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta Reviewed-by: Stefan Hajnoczi --- stubs/Makefile.objs | 1 + stubs/io_uring.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 stubs/io_uring.c diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 269dfa5832..86ceca5c4e 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -13,6 +13,7 @@ stub-obj-y +=3D iothread.o stub-obj-y +=3D iothread-lock.o stub-obj-y +=3D is-daemonized.o stub-obj-$(CONFIG_LINUX_AIO) +=3D linux-aio.o +stub-obj-$(CONFIG_LINUX_IO_URING) +=3D io_uring.o stub-obj-y +=3D machine-init-done.o stub-obj-y +=3D migr-blocker.o stub-obj-y +=3D change-state-handler.o diff --git a/stubs/io_uring.c b/stubs/io_uring.c new file mode 100644 index 0000000000..622d1e4648 --- /dev/null +++ b/stubs/io_uring.c @@ -0,0 +1,32 @@ +/* + * Linux io_uring support. + * + * Copyright (C) 2009 IBM, Corp. + * Copyright (C) 2009 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "block/aio.h" +#include "block/raw-aio.h" + +void luring_detach_aio_context(LuringState *s, AioContext *old_context) +{ + abort(); +} + +void luring_attach_aio_context(LuringState *s, AioContext *new_context) +{ + abort(); +} + +LuringState *luring_init(Error **errp) +{ + abort(); +} + +void luring_cleanup(LuringState *s) +{ + abort(); +} -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483307; cv=none; d=zoho.com; s=zohoarc; b=lpbJmmkFUSquAeKKSvX6EoToDh9ctH+ORRl7rv9Re8eesuT67esS/XGsHtZsQ99Y4J4N3akK9g+gzNmf+mecu05bdoNNBk289oGJvtihMlpSHsHODmh19bqRkH65iKdrHlPTDFy8cqEJJnUucBtm5zmBGhd1sUMTzEk1AGlgjoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483307; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=HFBwuOKEbqexqwPgrKzRL4NNTvNhKQclyEPlvywkxJs=; b=DTnbqNuVIuZ77H35cXfSug1gFOfV0Py1/HayDK4usDzlQciLKNWH94E5aNB/KnWca5/OQoUkrJtkOaGys5w7XbOhMU5m+ENmlcckARMTIbjw9+/pF8b8TDKiHJO70GhWF8Ak+Grqe236N0lTcfJNxht6PgT28bFK5LwvR54tnM0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483307985101.38306501147622; Tue, 21 May 2019 17:01:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:32912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEhK-0001iO-W0 for importer@patchew.org; Tue, 21 May 2019 20:01:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcV-0005iQ-5A for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYs-0001j3-KL for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:51 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:39077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYs-0001ij-F8; Tue, 21 May 2019 19:52:50 -0400 Received: by mail-pf1-x441.google.com with SMTP id z26so276701pfg.6; Tue, 21 May 2019 16:52:50 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:48 -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:in-reply-to:references; bh=HFBwuOKEbqexqwPgrKzRL4NNTvNhKQclyEPlvywkxJs=; b=rO1UXrDK9jTzkhu+6kaDlqwnX3bPbTNFxaOfQuwgzABgp0BJHEfFHYN/4c0X0hnYOm 5tSpvxL50yYL9QrTI1QDwED63lwJ+5a3adDCvaLROGH5XJRVKeYHlJVNZ6CJn9JVkTLr rUOy5IetczVYw07KEp7051J+KPivqfWhLjlSj1qlPTGu1jBdxWIB8schOf54yHYGhO0M D04OmcbBalHZ6RLv3uY+dd5F20TdE+s3rztJY6lZSlvnSwblfsuiUhzoAE4Pb5hbRNJw SY7HA/sOCbqUQ6NLvJV68/VwKri0FUWbjlSJ3TQ9WXEx76Euxod/Dne8wmhT0nfx37lI cq1w== 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:in-reply-to :references; bh=HFBwuOKEbqexqwPgrKzRL4NNTvNhKQclyEPlvywkxJs=; b=hChM1VOBEEQaGG3y5Rch31jfa5K76wlh0A2SaLH2Njc3fHT/wGyMcdIl10/qbFsher zJ5O5jTD52vzfe19f9Bbn1BkfxgZfMDEO+VsPuPUD9XdIc7dpuD4YZwWteIzzLtWyme8 Okr7xTZ+w2TJJMjbLQRWjHbSEDPGO57w2rhd3Dk9FVKp1yV6XZtLSAWTT9+aTpGkHkrm 6HVhajVzXrjFw3rQcNE1LyzbMT8cyRGER4ysD1666bMx4naQqhcBVJGpipN+KQEVm1E4 +YIPQezbGiIZ1QoWyX5HR8JYKTl+00m3B1xUQb6J6JIb6gcQT2FZO5T81xBRiAhfae+t 7N+Q== X-Gm-Message-State: APjAAAXXKZev12h9anrecR4/fvZ5kRSfsdF7nH6rax3kYL+gmrSGiVXO VYbhW9oMvkiy/9VZuziSurRO/IuVMI1Qtg== X-Google-Smtp-Source: APXvYqx3Z/px+tuLCUbtnRfSLoCItyYKrqbM0NNIiB5m5HbbR1omm9nam5H+2MmEgKYnB4zdzX8RgA== X-Received: by 2002:aa7:9a99:: with SMTP id w25mr52155463pfi.249.1558482769204; Tue, 21 May 2019 16:52:49 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:11 +0530 Message-Id: <20190521235215.31341-6-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [RFC PATCH 5/9] util/asyn: add aio interfaces for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- util/async.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/util/async.c b/util/async.c index c10642a385..dd45aff8f5 100644 --- a/util/async.c +++ b/util/async.c @@ -277,6 +277,14 @@ aio_ctx_finalize(GSource *source) } #endif +#ifdef CONFIG_LINUX_IO_URING + if (ctx->linux_io_uring) { + luring_detach_aio_context(ctx->linux_io_uring, ctx); + luring_cleanup(ctx->linux_io_uring); + ctx->linux_io_uring =3D NULL; + } +#endif + assert(QSLIST_EMPTY(&ctx->scheduled_coroutines)); qemu_bh_delete(ctx->co_schedule_bh); @@ -341,6 +349,25 @@ LinuxAioState *aio_get_linux_aio(AioContext *ctx) } #endif +#ifdef CONFIG_LINUX_IO_URING +LuringState *aio_setup_linux_io_uring(AioContext *ctx, Error **errp) +{ + if (!ctx->linux_io_uring) { + ctx->linux_io_uring =3D luring_init(errp); + if (ctx->linux_io_uring) { + luring_attach_aio_context(ctx->linux_io_uring, ctx); + } + } + return ctx->linux_io_uring; +} + +LuringState *aio_get_linux_io_uring(AioContext *ctx) +{ + assert(ctx->linux_io_uring); + return ctx->linux_io_uring; +} +#endif + void aio_notify(AioContext *ctx) { /* Write e.g. bh->scheduled before reading ctx->notify_me. Pairs @@ -432,6 +459,11 @@ AioContext *aio_context_new(Error **errp) #ifdef CONFIG_LINUX_AIO ctx->linux_aio =3D NULL; #endif + +#ifdef CONFIG_LINUX_IO_URING + ctx->linux_io_uring =3D NULL; +#endif + ctx->thread_pool =3D NULL; qemu_rec_mutex_init(&ctx->lock); timerlistgroup_init(&ctx->tlg, aio_timerlist_notify, ctx); -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483204; cv=none; d=zoho.com; s=zohoarc; b=gkI6l2HK/09+l9Gljk7Tedo8j1ZVDiThumzxNuU3vXqxRzLHwTxCUUCNoa9FzmC/2ZlNlKwOEpf/MQgwE40xHXI54YM7cJ+g1TUF95mgV8zfWN2Wjv4bfqMFyCaFV6mII0dHWuPElOfYSmXSySA35/a8CO20Ym7PEq3HfSs2WIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483204; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rZoSYzQBqztWJbTLj3mPksJxb8vygw+5t40niBgkeQo=; b=jy5hrLvrn4ZsyB9xzCsoJnooPIT1GL/DmOwFtqDJ6lLxgV29Jf8VWnVQWuuSyOc27kh2W0tKD4SopWOUoHw8DyK0rMKkq+RB8XwmwLabu2Pjzej9WgXgkSsqBJEEu11UT21i1w17xt8320FZv9T5yg2ZHn4TZPv4NHxGO5/kD+c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483204689502.39034546879304; Tue, 21 May 2019 17:00:04 -0700 (PDT) Received: from localhost ([127.0.0.1]:32827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEfl-0008Dz-6v for importer@patchew.org; Tue, 21 May 2019 19:59:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcT-0005iQ-6l for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYw-0001lv-LI for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:56 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:41193) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYw-0001lW-Dy; Tue, 21 May 2019 19:52:54 -0400 Received: by mail-pf1-x443.google.com with SMTP id q17so271697pfq.8; Tue, 21 May 2019 16:52:54 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:52 -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:in-reply-to:references; bh=rZoSYzQBqztWJbTLj3mPksJxb8vygw+5t40niBgkeQo=; b=CRvUvTEZEC11SbSl6KIwrB9oY7h2SyAZJSHkrnml2UNlijjmOzEG0FXd15TUwl6Efl CiC+db0hspoXJlQLqmSD2fwrOTr+paT6HhL0gxrM200EHAqXvqfaZky6swnN91kH5/qO 0EnL2k6hpQVgzY50TWI83PsEJgggkxmjjJwSuJ5YMyeWYVBGq8s05SZvIEMhxPCdEXgw RQCOh5RLv8PnyD+XAJ5JxYx3JghoBqK7VNfBOPfvwPigte9eVv9i3uknRiyCIO1ZYmUO bqC1i5/DF3tfYcwkvWBdWvuL25oLNcJt0ufD+KlwE4eEPASrA51qqCbaFoevWiunmVEy kCKg== 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:in-reply-to :references; bh=rZoSYzQBqztWJbTLj3mPksJxb8vygw+5t40niBgkeQo=; b=AHxv1GlRdnkX/Ja5YKYUzyi+1DacW/V+2J5k/7DAV7KlBwXN0Rq4wbcuff35eJaahd d4RXIT6tp27Fp5TYSvPCvlW4h1fw/a/4xYFGHVOFxltn38dgw97NNi5U7eWw1rBoLbL2 3FQpPfBkZwvcF54ss/sQQkCclGb3EMNsoNFWN/J812zjsBEH2fZIVaG7OCSZjs5PGDH7 3fBw2UNasvPABz/Drw2sQjQySMtoGY5MAN7WkO4VOwz1aF6f1/mSf06CZgKzbAVJeHIL Rj6vyi9Ui1IF++ChjRPFOBa+qazKrFo0yUwKvgj326HJXfN4srSGcdx6Xm0xqqbwXdRX uXAQ== X-Gm-Message-State: APjAAAVjNcvVKLsyodznzkR8uVHR5kN8Mks537RZhBpeS44KiotdD0i2 etCv9rrS268LHGj8akc1/apEVsf1ZqC9uA== X-Google-Smtp-Source: APXvYqwmdIQgI1bW41DrLEY0Y54nKWTpDNK3D/wj5bORvizEmPG2DWVSGEwZ0D8luJ8Zm97zFLwYxQ== X-Received: by 2002:a63:c046:: with SMTP id z6mr86021366pgi.387.1558482772885; Tue, 21 May 2019 16:52:52 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:12 +0530 Message-Id: <20190521235215.31341-7-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [RFC PATCH 6/9] block/io_uring: implements interfaces for io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- block/Makefile.objs | 2 + block/io_uring.c | 385 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 387 insertions(+) create mode 100644 block/io_uring.c diff --git a/block/Makefile.objs b/block/Makefile.objs index 7a81892a52..262d413c6d 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -18,6 +18,7 @@ block-obj-y +=3D block-backend.o snapshot.o qapi.o block-obj-$(CONFIG_WIN32) +=3D file-win32.o win32-aio.o block-obj-$(CONFIG_POSIX) +=3D file-posix.o block-obj-$(CONFIG_LINUX_AIO) +=3D linux-aio.o +block-obj-$(CONFIG_LINUX_IO_URING) +=3D io_uring.o block-obj-y +=3D null.o mirror.o commit.o io.o create.o block-obj-y +=3D throttle-groups.o block-obj-$(CONFIG_LINUX) +=3D nvme.o @@ -61,5 +62,6 @@ block-obj-$(if $(CONFIG_LZFSE),m,n) +=3D dmg-lzfse.o dmg-lzfse.o-libs :=3D $(LZFSE_LIBS) qcow.o-libs :=3D -lz linux-aio.o-libs :=3D -laio +io_uring.o-libs :=3D -luring parallels.o-cflags :=3D $(LIBXML2_CFLAGS) parallels.o-libs :=3D $(LIBXML2_LIBS) diff --git a/block/io_uring.c b/block/io_uring.c new file mode 100644 index 0000000000..f8b0df90d4 --- /dev/null +++ b/block/io_uring.c @@ -0,0 +1,385 @@ +/* + * Linux io_uring support. + * + * Copyright (C) 2009 IBM, Corp. + * Copyright (C) 2009 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "block/aio.h" +#include "qemu/queue.h" +#include "block/block.h" +#include "block/raw-aio.h" +#include "qemu/event_notifier.h" +#include "qemu/coroutine.h" +#include "qapi/error.h" + +#include + +/* + * Queue size (per-device). + * + * XXX: eventually we need to communicate this to the guest and/or make it + * tunable by the guest. If we get more outstanding requests at a ti= me + * than this we will get EAGAIN from io_submit which is communicated = to + * the guest as an I/O error. + */ +#define MAX_EVENTS 128 + +struct qemu_luringcb { + BlockAIOCB common; + Coroutine *co; + LuringState *ctx; + struct io_uring_sqe sqeq; + int ret; + size_t nbytes; + QEMUIOVector *qiov; + bool is_read; + QSIMPLEQ_ENTRY(qemu_luringcb) next; +}; + +typedef struct { + int plugged; + unsigned int in_queue; + unsigned int in_flight; + bool blocked; + QSIMPLEQ_HEAD(, qemu_luringcb) pending; +} LuringQueue; + +struct LuringState { + AioContext *aio_context; + + struct io_uring ring; + EventNotifier e; + + /* io queue for submit at batch. Protected by AioContext lock. */ + LuringQueue io_q; + + /* I/O completion processing. Only runs in I/O thread. */ + QEMUBH *completion_bh; + int event_idx; + int event_max; +}; + +static void ioq_submit(LuringState *s); + +static inline int32_t io_cqe_ret(struct io_uring_cqe *cqe) +{ + return cqe->res; +} + +/** + * io_getevents_peek: + * @ring: io_uring instance + * @cqes: Completion event array + + * Returns the number of completed events and sets a pointer + * on events queue. This function does not update the head and tail. + */ +static inline unsigned int io_getevents_peek(struct io_uring *ring, + struct io_uring_cqe **cqes) +{ + unsigned int nr; + read_barrier(); + struct io_uring_cq *cq_ring =3D &ring->cq; + unsigned int head =3D *cq_ring->khead & *cq_ring->kring_mask; + unsigned int tail =3D *cq_ring->ktail & *cq_ring->kring_mask; + nr =3D tail - head; + *cqes =3D ring->cq.cqes; + return nr; +} + +/** + * qemu_luring_process_completions: + * @s: AIO state + * + * Fetches completed I/O requests, consumes cqes and invokes their callbac= ks. + * + */ +static void qemu_luring_process_completions(LuringState *s) +{ + struct io_uring_cqe *cqes; + qemu_bh_schedule(s->completion_bh); + + while ((s->event_max =3D io_getevents_peek(&s->ring, &cqes))) { + for (s->event_idx =3D 0; s->event_idx < s->event_max; ) { + io_uring_cqe_seen(&s->ring, cqes); + + /* Change counters one-by-one because we can be nested. */ + s->io_q.in_flight--; + s->event_idx++; + } + } + + qemu_bh_cancel(s->completion_bh); + + /* + *If we are nested we have to notify the level above that we are done + * by setting event_max to zero, upper level will then jump out of it's + * own `for` loop. If we are the last all counters dropped to zero. + */ + s->event_max =3D 0; + s->event_idx =3D 0; +} + +static void qemu_luring_process_completions_and_submit(LuringState *s) +{ + aio_context_acquire(s->aio_context); + qemu_luring_process_completions(s); + + if (!s->io_q.plugged && !QSIMPLEQ_EMPTY(&s->io_q.pending)) { + ioq_submit(s); + } + aio_context_release(s->aio_context); +} + +static void qemu_luring_completion_bh(void *opaque) +{ + LuringState *s =3D opaque; + + qemu_luring_process_completions_and_submit(s); +} + +static void qemu_luring_completion_cb(EventNotifier *e) +{ + LuringState *s =3D container_of(e, LuringState, e); + + if (event_notifier_test_and_clear(&s->e)) { + qemu_luring_process_completions_and_submit(s); + } +} + +static bool qemu_luring_poll_cb(void *opaque) +{ + EventNotifier *e =3D opaque; + LuringState *s =3D container_of(e, LuringState, e); + struct io_uring_cqe *cqes; + + if (!io_getevents_peek(&s->ring, &cqes)) { + return false; + } + + qemu_luring_process_completions_and_submit(s); + return true; +} + +static const AIOCBInfo luring_aiocb_info =3D { + .aiocb_size =3D sizeof(struct qemu_luringcb), +}; + + +static void ioq_init(LuringQueue *io_q) +{ + QSIMPLEQ_INIT(&io_q->pending); + io_q->plugged =3D 0; + io_q->in_queue =3D 0; + io_q->in_flight =3D 0; + io_q->blocked =3D false; +} + +static void ioq_submit(LuringState *s) +{ + int ret, len; + struct qemu_luringcb *aiocb; + QSIMPLEQ_HEAD(, qemu_luringcb) completed; + + do { + if (s->io_q.in_flight >=3D MAX_EVENTS) { + break; + } + len =3D 0; + QSIMPLEQ_FOREACH(aiocb, &s->io_q.pending, next) { + if (s->io_q.in_flight + len++ >=3D MAX_EVENTS) { + break; + } + struct io_uring_sqe *sqes =3D io_uring_get_sqe(&s->ring); + if (sqes) { /* Prep sqe for subission */ + memset(sqes, 0, sizeof(*sqes)); + sqes->opcode =3D aiocb->sqeq.opcode; + sqes->fd =3D aiocb->sqeq.fd; + if (sqes->opcode =3D=3D IORING_OP_FSYNC) { + sqes->fsync_flags =3D aiocb->sqeq.fsync_flags; + } + else { + sqes->off =3D aiocb->sqeq.off; + sqes->addr =3D aiocb->sqeq.addr; + sqes->len =3D aiocb->sqeq.len; + } + QSIMPLEQ_REMOVE_HEAD(&s->io_q.pending, next); + } + } + + ret =3D io_uring_submit(&s->ring); + if (ret =3D=3D -EAGAIN) { + break; + } + + s->io_q.in_flight +=3D ret; + s->io_q.in_queue -=3D ret; + QSIMPLEQ_SPLIT_AFTER(&s->io_q.pending, aiocb, next, &completed); + } while (!QSIMPLEQ_EMPTY(&s->io_q.pending)); + s->io_q.blocked =3D (s->io_q.in_queue > 0); + + if (s->io_q.in_flight) { + /* + * We can try to complete something just right away if there are + * still requests in-flight. + */ + qemu_luring_process_completions(s); + } +} + +void luring_io_plug(BlockDriverState *bs, LuringState *s) +{ + s->io_q.plugged++; +} + +void luring_io_unplug(BlockDriverState *bs, LuringState *s) +{ + assert(s->io_q.plugged); + if (--s->io_q.plugged =3D=3D 0 && + !s->io_q.blocked && !QSIMPLEQ_EMPTY(&s->io_q.pending)) { + ioq_submit(s); + } +} + +static int luring_do_submit(int fd, struct qemu_luringcb *luringcb, + off_t offset, int type) +{ + LuringState *s =3D luringcb->ctx; + struct io_uring_sqe *sqes =3D io_uring_get_sqe(&s->ring); + if (!sqes) { + sqes =3D &luringcb->sqeq; + QSIMPLEQ_INSERT_TAIL(&s->io_q.pending, luringcb, next); + } + QEMUIOVector *qiov =3D luringcb->qiov; + + switch (type) { + case QEMU_AIO_WRITE: + io_uring_prep_writev(sqes, fd, qiov->iov, qiov->niov, offset); + break; + case QEMU_AIO_READ: + io_uring_prep_readv(sqes, fd, qiov->iov, qiov->niov, offset); + break; + case QEMU_AIO_FLUSH: + io_uring_prep_fsync(sqes, fd, 0); + break; + default: + fprintf(stderr, "%s: invalid AIO request type 0x%x.\n", + __func__, type); + return -EIO; + } + + s->io_q.in_queue++; + if (!s->io_q.blocked && + (!s->io_q.plugged || + s->io_q.in_flight + s->io_q.in_queue >=3D MAX_EVENTS)) { + ioq_submit(s); + } + + return 0; +} + +int coroutine_fn luring_co_submit(BlockDriverState *bs, LuringState *s, in= t fd, + uint64_t offset, QEMUIOVector *qiov, int t= ype) +{ + int ret; + struct qemu_luringcb luringcb =3D { + .co =3D qemu_coroutine_self(), + .nbytes =3D qiov->size, + .ctx =3D s, + .ret =3D -EINPROGRESS, + .is_read =3D (type =3D=3D QEMU_AIO_READ), + .qiov =3D qiov, + }; + + ret =3D luring_do_submit(fd, &luringcb, offset, type); + if (ret < 0) { + return ret; + } + + if (luringcb.ret =3D=3D -EINPROGRESS) { + qemu_coroutine_yield(); + } + return luringcb.ret; +} + +BlockAIOCB *luring_submit(BlockDriverState *bs, LuringState *s, int fd, + int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + BlockCompletionFunc *cb, void *opaque, int type) +{ + struct qemu_luringcb *luringcb; + off_t offset =3D sector_num * BDRV_SECTOR_SIZE; + int ret; + + luringcb =3D qemu_aio_get(&luring_aiocb_info, bs, cb, opaque); + luringcb->nbytes =3D nb_sectors * BDRV_SECTOR_SIZE; + luringcb->ctx =3D s; + luringcb->ret =3D -EINPROGRESS; + luringcb->is_read =3D (type =3D=3D QEMU_AIO_READ); + luringcb->qiov =3D qiov; + + ret =3D luring_do_submit(fd, luringcb, offset, type); + if (ret < 0) { + qemu_aio_unref(luringcb); + return NULL; + } + + return &luringcb->common; +} + +void luring_detach_aio_context(LuringState *s, AioContext *old_context) +{ + aio_set_event_notifier(old_context, &s->e, false, NULL, NULL); + qemu_bh_delete(s->completion_bh); + s->aio_context =3D NULL; +} + +void luring_attach_aio_context(LuringState *s, AioContext *new_context) +{ + s->aio_context =3D new_context; + s->completion_bh =3D aio_bh_new(new_context, qemu_luring_completion_bh= , s); + aio_set_event_notifier(new_context, &s->e, false, + qemu_luring_completion_cb, + qemu_luring_poll_cb); +} + +LuringState *luring_init(Error **errp) +{ + int rc; + LuringState *s; + s =3D g_malloc0(sizeof(*s)); + rc =3D event_notifier_init(&s->e, false); + if (rc < 0) { + error_setg_errno(errp, -rc, "failed to to initialize event notifie= r"); + goto out_free_state; + } + + struct io_uring *ring =3D &s->ring; + rc =3D io_uring_queue_init(MAX_EVENTS, ring, 0); + if (rc < 0) { + error_setg_errno(errp, -rc, "failed to create linux io_uring queue= "); + goto out_close_efd; + } + + ioq_init(&s->io_q); + aio_set_fd_handler(s->aio_context, ring->ring_fd, false, + (IOHandler *)qemu_luring_completion_cb, NULL, NULL,= &s); + return s; + +out_close_efd: + event_notifier_cleanup(&s->e); +out_free_state: + g_free(s); + return NULL; +} + +void luring_cleanup(LuringState *s) +{ + event_notifier_cleanup(&s->e); + io_uring_queue_exit(&s->ring); + g_free(s); +} -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483137; cv=none; d=zoho.com; s=zohoarc; b=ciYfVowc9kPeZH2+lC7yjEXQ2k0QiihMjCoNsVh6t7Rt31xzQo7umHry7dM6q4s0QfISEiGpClqn0K3ddE/Zon3c5D7UIvhV5w6FcAsnsn/VWsJWK+uvEquS12RbzC8fda5tiGsakKlf3YrxxqwZDWGMBc+sY+JEVvaM9cRpjKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483137; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=bhbpjK0JQSStbd9y2pHNMHs1B0N4hnvXiiUW+QxkFQ4=; b=kySGzIYA5FpKh92mgdOM2lPdj7SCrhETgrxHsZWiIK7byPPKJNQCFvApenx22JKwACWyrMjk+o7EBFzq1wIlpqsJN3GWITDKQr4rlNPMCZUzGWAmVCAmcp4Wo+PE/poAfBzgtQH65e9c8mzwkysPAXUDBtN87B8Ae2ASGwD1XHI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483137597817.0759761254352; Tue, 21 May 2019 16:58:57 -0700 (PDT) Received: from localhost ([127.0.0.1]:32825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEee-0007Hs-KG for importer@patchew.org; Tue, 21 May 2019 19:58:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcQ-0005iQ-1n for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEYz-0001oN-Th for qemu-devel@nongnu.org; Tue, 21 May 2019 19:52:58 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:41490) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEYz-0001nm-O7; Tue, 21 May 2019 19:52:57 -0400 Received: by mail-pl1-x644.google.com with SMTP id f12so114243plt.8; Tue, 21 May 2019 16:52:57 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:55 -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:in-reply-to:references; bh=bhbpjK0JQSStbd9y2pHNMHs1B0N4hnvXiiUW+QxkFQ4=; b=pCu8Efb1/mghqX2oFjPAH4VPTNqfsIR9hradxpChsTVT/5d0/8+HfAS68CZSYhbBnx v3tQDkf7V+dKDe+27A6TDUh6L4E33z6Iyu7+HbBCp5Rn/p748OBHZjQsgdDi8I8ncG53 JZxs1S6GzV/b9TzowH3uDlNbLFEhzla45xV4nNj1xYlSSdifRoejE4M/aGfyoB0m5pWM qso6WN2t7946wCZgjVgZcStcGEMGW8WTAjobb4SJGl/vCuRzRdE4eGvPtySyJBF4IVuz oMeaJATNwytjqJiVt+xKMrSUUL8tCiuFNTtL9wT4KJLhrUo5y5VOW9AVZ2VUxKqz8qFV amgA== 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:in-reply-to :references; bh=bhbpjK0JQSStbd9y2pHNMHs1B0N4hnvXiiUW+QxkFQ4=; b=AwoYs3IO/2devXNHsl8PutwNcujwRdIxhiFMiGa7uWgQ/yKwecvKNndCeOOTowijyS /ntxgFWIDlW3ynIXauMAOkSEGpxYs3VoaVWvFfe5t/fr5H7Q5ShoCH4wYidKhWNhiHUW j59vSj/4ODbTDvIc1CP4HUCJEzQ0r0MfxzkNdbF5kYuK6u8/AMUxohx+dx4oHYpBxFaP xHtLwdYbT2Zi4nGi8TID0ckuhvwcFri6Jr6nY59t3oPgChejvsp352gwFnJDtHb1d+sM dE5Y141aoUYgqjQAXn2A0PKPBZssa9FYnxsUtnVvDPvoRV+qgFQ9wnw/Oh0m0L9f7rjD U9iQ== X-Gm-Message-State: APjAAAW3Zd68X46M9Bu4oSAyiB63/XPMB+/OqpaGFIPey+ZMv/gqpfDj +LIJKBtp20gXgwmybjgcBG5jjSs3M2TIyg== X-Google-Smtp-Source: APXvYqzP6YHMsqEBTfn2Aid7dGuCCRcejMNgdc6FiqDH7CCC6K+JdYK7nw8tWg78JhFFvUrbA1QPMg== X-Received: by 2002:a17:902:28c9:: with SMTP id f67mr67267566plb.190.1558482776506; Tue, 21 May 2019 16:52:56 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:13 +0530 Message-Id: <20190521235215.31341-8-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [RFC PATCH 7/9] blockdev: accept io_uring as option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- blockdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 79fbac8450..b44b9d660d 100644 --- a/blockdev.c +++ b/blockdev.c @@ -386,6 +386,8 @@ static void extract_common_blockdev_options(QemuOpts *o= pts, int *bdrv_flags, if ((aio =3D qemu_opt_get(opts, "aio")) !=3D NULL) { if (!strcmp(aio, "native")) { *bdrv_flags |=3D BDRV_O_NATIVE_AIO; + } else if (!strcmp(aio, "io_uring")) { + *bdrv_flags |=3D BDRV_O_IO_URING; } else if (!strcmp(aio, "threads")) { /* this is the default */ } else { @@ -4547,7 +4549,7 @@ QemuOptsList qemu_common_drive_opts =3D { },{ .name =3D "aio", .type =3D QEMU_OPT_STRING, - .help =3D "host AIO implementation (threads, native)", + .help =3D "host AIO implementation (threads, native, io_uring)= ", },{ .name =3D BDRV_OPT_CACHE_WB, .type =3D QEMU_OPT_BOOL, -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483139; cv=none; d=zoho.com; s=zohoarc; b=ALsCnyKWSJt13km2BhUsnqvxrwuI87VGazUP9NDssMwg63NUUQdUrwo/a9j/nFmQsHHWixDQQZ2evl4HMUAN4r6dIjxC5oBNdc/6eKZ6GmZmyfQCac4LDXZ85RrmhT4ihK4Xs/lvmvgH7o3/BMQ4UeEfM5RZusT1u4LJ2ibg3Gs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483139; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Gj1H7BTnoNvkp48yhjN3bE5xK+DRFHACTLF5AwUVMgo=; b=Vhd4ZFUK8dPEeiyywAv/7xYs+TcUBVY9keHwQ+711PGKsdBo+X3OlNyvwRI49WPL0kPCjV9y0wil25exyXSLMLts+wRAr8w7P+QS+rjG1+JL1FUjo59nFVeUXQjDZtANQJYR+avmGoftolrOPlHgYbhfcSivBFn1gUpu+BLQBCo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 155848313927165.32939274544492; Tue, 21 May 2019 16:58:59 -0700 (PDT) Received: from localhost ([127.0.0.1]:32823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEed-0007Fr-7U for importer@patchew.org; Tue, 21 May 2019 19:58:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcK-0005iQ-Og for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEZ3-0001qJ-Gn for qemu-devel@nongnu.org; Tue, 21 May 2019 19:53:02 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:39720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEZ3-0001pz-Ax; Tue, 21 May 2019 19:53:01 -0400 Received: by mail-pg1-x544.google.com with SMTP id w22so307547pgi.6; Tue, 21 May 2019 16:53:01 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.52.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:52:59 -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:in-reply-to:references; bh=Gj1H7BTnoNvkp48yhjN3bE5xK+DRFHACTLF5AwUVMgo=; b=To+xm8ZK002sUar6/wjXpBl9tAvuy5A9z3jXm+xU0Iiy1w6G+V+tuhY1asF2WrYl5p M6bLvoPHZ8txQm6GoasW7r+YMT3JdZ/o7CaqQVl8/pLus8y/PFUJWntLHsK2RcQ/P/HY zNZoB293MGQcMSMPhk4t4hb/1indCMrdlrczttY88ImRclPnkg58Nu9NXFrNuef1fx5m fJ4Mt2zdiD34o/V3/p1lwhWt9fCf09qk/7NM1z7p7JYH+YccNSdnV+6qlBY+m9qnyEQK r5wIrMydQ//Cj7c9RrZU/BCE0BrrkWZj2HAJY1wHIbseTdh91VDxJWZWzar+b/RNvGSJ PDEw== 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:in-reply-to :references; bh=Gj1H7BTnoNvkp48yhjN3bE5xK+DRFHACTLF5AwUVMgo=; b=aW3HjMIGwB9PMbWhSy4DpH19qLqVMEXWnl6lZNBw/2pMwKk7HgRvM10neSL9Xsaqhb YHV+BkRM7TS0jXzr8CIyqbbOuUMQRm9w0qAI0SclWbil89I9nwEXLE8y/2T0SgQkzLYk iRzTk+1p8CuXnQ0FFfdDkPgbw5JQFiCg2xt1pi5OMBtmwFBEk+NcYtOQQTzvUqH6Qsrw etXPqESjZryBhvrSRqczq7BdVY7TDcGplxSFxu8giFhpzxZ+G61l0UU1zz+YGwW4D5/W wRynUAmKyIaPLYwJ4yyEuqVZ/ra1qprxEkuqhfULys5mOUu86d3ZZfhwCUItvy6S5blY qHWQ== X-Gm-Message-State: APjAAAUjoPUc5uQ8e4yz8qUJ3yDpTHJY8HH2y22teIHfjGQ0+FQy7+Kx zxdiSkO40N52J6sH5pi79xLy46RG96OYaA== X-Google-Smtp-Source: APXvYqwT3SUaOiSoAgO2ZqLusTFeI8bEUt+fZ1bj3jgFgR5m/V3mdXzb1zhj9GK+0gU9Igo5Vsh/RQ== X-Received: by 2002:a65:640c:: with SMTP id a12mr23600702pgv.1.1558482780074; Tue, 21 May 2019 16:53:00 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:14 +0530 Message-Id: <20190521235215.31341-9-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [RFC PATCH 8/9] block/file-posix: extends to use with io_uring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- block/file-posix.c | 63 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 1cf4ee49eb..41952217a4 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -154,6 +154,7 @@ typedef struct BDRVRawState { bool has_write_zeroes:1; bool discard_zeroes:1; bool use_linux_aio:1; + bool use_linux_io_uring; bool page_cache_inconsistent:1; bool has_fallocate; bool needs_alignment; @@ -423,7 +424,7 @@ static QemuOptsList raw_runtime_opts =3D { { .name =3D "aio", .type =3D QEMU_OPT_STRING, - .help =3D "host AIO implementation (threads, native)", + .help =3D "host AIO implementation (threads, native, io_uring)= ", }, { .name =3D "locking", @@ -494,6 +495,7 @@ static int raw_open_common(BlockDriverState *bs, QDict = *options, goto fail; } s->use_linux_aio =3D (aio =3D=3D BLOCKDEV_AIO_OPTIONS_NATIVE); + s->use_linux_io_uring =3D (aio =3D=3D BLOCKDEV_AIO_OPTIONS_IO_URING); locking =3D qapi_enum_parse(&OnOffAuto_lookup, qemu_opt_get(opts, "locking"), @@ -557,7 +559,9 @@ static int raw_open_common(BlockDriverState *bs, QDict = *options, s->shared_perm =3D BLK_PERM_ALL; #ifdef CONFIG_LINUX_AIO - /* Currently Linux does AIO only for files opened with O_DIRECT */ + /* + * Currently Linux does AIO only for files opened with O_DIRECT + */ if (s->use_linux_aio) { if (!(s->open_flags & O_DIRECT)) { error_setg(errp, "aio=3Dnative was specified, but it requires " @@ -578,6 +582,21 @@ static int raw_open_common(BlockDriverState *bs, QDict= *options, goto fail; } #endif /* !defined(CONFIG_LINUX_AIO) */ +#ifdef CONFIG_LINUX_IO_URING + if (s->use_linux_io_uring) { + if (!aio_setup_linux_io_uring(bdrv_get_aio_context(bs), errp)) { + error_prepend(errp, "Unable to use io_uring: "); + goto fail; + } + } +#else + if (s->use_linux_io_uring) { + error_setg(errp, "aio=3Dio_uring was specified, but is not support= ed " + "in this build."); + ret =3D -EINVAL; + goto fail; + } +#endif /* !defined(CONFIG_LINUX_IO_URING) */ s->has_discard =3D true; s->has_write_zeroes =3D true; @@ -1870,6 +1889,12 @@ static int coroutine_fn raw_co_prw(BlockDriverState = *bs, uint64_t offset, LinuxAioState *aio =3D aio_get_linux_aio(bdrv_get_aio_context(= bs)); assert(qiov->size =3D=3D bytes); return laio_co_submit(bs, aio, s->fd, offset, qiov, type); +#endif +#ifdef CONFIG_LINUX_IO_URING + } else if (s->use_linux_io_uring) { + LuringState *aio =3D aio_get_linux_io_uring(bdrv_get_aio_conte= xt(bs)); + assert(qiov->size =3D=3D bytes); + return luring_co_submit(bs, aio, s->fd, offset, qiov, type); #endif } } @@ -1907,24 +1932,40 @@ static int coroutine_fn raw_co_pwritev(BlockDriverS= tate *bs, uint64_t offset, static void raw_aio_plug(BlockDriverState *bs) { -#ifdef CONFIG_LINUX_AIO +#if defined CONFIG_LINUX_AIO || defined CONFIG_LINUX_IO_URING BDRVRawState *s =3D bs->opaque; +#endif +#ifdef CONFIG_LINUX_AIO if (s->use_linux_aio) { LinuxAioState *aio =3D aio_get_linux_aio(bdrv_get_aio_context(bs)); laio_io_plug(bs, aio); } #endif +#ifdef CONFIG_LINUX_IO_URING + if (s->use_linux_io_uring) { + LuringState *aio =3D aio_get_linux_io_uring(bdrv_get_aio_context(b= s)); + luring_io_plug(bs, aio); + } +#endif } static void raw_aio_unplug(BlockDriverState *bs) { -#ifdef CONFIG_LINUX_AIO +#if defined CONFIG_LINUX_AIO || defined CONFIG_LINUX_IO_URING BDRVRawState *s =3D bs->opaque; +#endif +#ifdef CONFIG_LINUX_AIO if (s->use_linux_aio) { LinuxAioState *aio =3D aio_get_linux_aio(bdrv_get_aio_context(bs)); laio_io_unplug(bs, aio); } #endif +#ifdef CONFIG_LINUX_IO_URING + if (s->use_linux_aio) { + LuringState *aio =3D aio_get_linux_io_uring(bdrv_get_aio_context(b= s)); + luring_io_unplug(bs, aio); + } +#endif } static int raw_co_flush_to_disk(BlockDriverState *bs) @@ -1950,8 +1991,10 @@ static int raw_co_flush_to_disk(BlockDriverState *bs) static void raw_aio_attach_aio_context(BlockDriverState *bs, AioContext *new_context) { +#if defined CONFIG_LINUX_AIO || defined CONFIG_LINUX_IO_URING + BDRVRawState *s =3D bs->opaque; +#endif #ifdef CONFIG_LINUX_AIO - BDRVRawState *s =3D bs->opaque; if (s->use_linux_aio) { Error *local_err; if (!aio_setup_linux_aio(new_context, &local_err)) { @@ -1961,6 +2004,16 @@ static void raw_aio_attach_aio_context(BlockDriverSt= ate *bs, } } #endif +#ifdef CONFIG_LINUX_IO_URING + if (s->use_linux_io_uring) { + Error *local_err; + if (!aio_setup_linux_io_uring(new_context, &local_err)) { + error_reportf_err(local_err, "Unable to use linux io_uring, " + "falling back to thread pool: "); + s->use_linux_io_uring =3D false; + } + } +#endif } static void raw_close(BlockDriverState *bs) -- 2.17.1 From nobody Fri May 17 08:39:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1558483127; cv=none; d=zoho.com; s=zohoarc; b=l2DqkTGJqKJjLh8GssaIE4qd10w80no1BmuuDykTqMc4whMqEPB1vZBgKr35zTf8AchrTyEswQSJSPLAkZSfOygddHY3n472xYIYWPpNvDiozkunmb5jdJBUnm8kcc2WpJM2SwPhwFTcqUWWUDcVHuXqJew7Wf8nrVR5XGxxZeA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558483127; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=UfXYBbV0s+nS162Op6TlJ/0zXxxvGFZzaHozLXuLUbw=; b=S9G+aCkuW1MI1GTGPLNdCP9RzZyJoUltsl64mWOPZ5uH+EE52TRxg/XYk/vFRh4dQ5jFh74oKDBZr8MH6YifDDDh7pvE40em8xtS1XEoQU6h6+t1SleQ2OOa88Qu4R3WRPGh0RWc4nCDP+KAASMa1y+02Ww8ItgQX3h/y2gpKk0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558483127510529.5870004478005; Tue, 21 May 2019 16:58:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:32821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEeU-0007BI-1h for importer@patchew.org; Tue, 21 May 2019 19:58:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTEcI-0005iQ-4L for qemu-devel@nongnu.org; Tue, 21 May 2019 19:56:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTEZ9-0001tW-Sx for qemu-devel@nongnu.org; Tue, 21 May 2019 19:53:08 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:39668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTEZ7-0001rk-Vs; Tue, 21 May 2019 19:53:06 -0400 Received: by mail-pl1-x641.google.com with SMTP id g9so118152plm.6; Tue, 21 May 2019 16:53:04 -0700 (PDT) Received: from localhost.localdomain ([120.57.118.207]) by smtp.gmail.com with ESMTPSA id e5sm51571752pgh.35.2019.05.21.16.53.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 16:53:02 -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:in-reply-to:references; bh=UfXYBbV0s+nS162Op6TlJ/0zXxxvGFZzaHozLXuLUbw=; b=GNjvQEzu0ShaumXDqu9+Ax4jI+mLHyxGbomG3LFH4WPDfRuwQIlOjDfS8kAFG2MWXo fc5eWTLfE9EOCB/7hnHBRVQHhc+ig9DOgjyHvHuP0gPfj0THWepyv7FkTVChEP4jhVXR StUZzDpgeiakKai6P4YXYRR22KpedVYJO0tQjw4n3b3rCQ5yOOmjfiLcT3TYfS1V/tII AW5phh5rChFpU8XiaNWmWnBpdc4spiNUcek0e/fc8o1WzBPI+Jcx8MqFM/kE40SZoMtP jjqdJ0nNZMtgeq6aI66Wl5pDLPVi0SegiP7dkvYfvMBNa5eOqNGZBEHn59BQqymoD/P7 YlzQ== 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:in-reply-to :references; bh=UfXYBbV0s+nS162Op6TlJ/0zXxxvGFZzaHozLXuLUbw=; b=IU2IN4NhZSwnsqLk2oyasxFqCFJvm9zTY6N/C2XL4KYDaT0KXqQrO5QqcUhBFmupff WzLCh2FSWKzBhzxN5qAUCqcR7+JPJGJj7OejRFCmqt+bQjSxBhGMEEkNrIcp7pZf7qwT nnB6sdKIYnd6kcIkC+BNEbykFVGBuBiJsa5dSS6yjoWM2mQWwdyOakicAl1+bn8J4ALS 78+kz/ZOA196EzUInR+CCXEVjnJDe8YBHZ9qidPMnWF/lM0Cndaj7Y7E6tcLrtXsmWry h7h6xGK2X5jN7/up8FeSNMUvG8GpCxSxuMpMy2DLV0WL5JTXCZJDGMMiVN2426q4dcMs fC5A== X-Gm-Message-State: APjAAAXhyn4j0mWXMHi+b0cgqIC8n8FYwzCYz9o+LA+hBGSnmrL0QlOa iY0YxWkXsCvZJv0dJknFrpF5BfLwKXnMbw== X-Google-Smtp-Source: APXvYqxgyjVj4iQnjK1eW6bSc/j0CqkgqGPOHP3OVJ0+JWjtCoU0xkTHHWgn7AkFLz2jrPQvY7VO5w== X-Received: by 2002:a17:902:7082:: with SMTP id z2mr63502540plk.176.1558482783536; Tue, 21 May 2019 16:53:03 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 05:22:15 +0530 Message-Id: <20190521235215.31341-10-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521235215.31341-1-mehta.aaru20@gmail.com> References: <20190521235215.31341-1-mehta.aaru20@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 Subject: [Qemu-devel] [RFC PATCH 9/9] configure: permits use of io_uring with probe X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saket.sinha89@gmail.com, Julia Suvorova , qemu-block@nongnu.org, Stefan Hajnoczi , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aarushi Mehta --- configure | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/configure b/configure index d2fc346302..25eb150cb5 100755 --- a/configure +++ b/configure @@ -365,6 +365,7 @@ xen=3D"" xen_ctrl_version=3D"" xen_pci_passthrough=3D"" linux_aio=3D"" +linux_io_uring=3D"" cap_ng=3D"" attr=3D"" libattr=3D"" @@ -1255,6 +1256,10 @@ for opt do ;; --enable-linux-aio) linux_aio=3D"yes" ;; + --disable-linux-io-uring) linux_io_uring=3D"no" + ;; + --enable-linux-io-uring) linux_io_uring=3D"yes" + ;; --disable-attr) attr=3D"no" ;; --enable-attr) attr=3D"yes" @@ -1773,6 +1778,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: vde support for vde network netmap support for netmap network linux-aio Linux AIO support + linux-io-uring Linux io_uring support cap-ng libcap-ng support attr attr and xattr support vhost-net vhost-net kernel acceleration support @@ -3949,6 +3955,23 @@ EOF linux_aio=3Dno fi fi +########################################## +# linux-io-uring probe + +if test "$linux_io_uring" !=3D "no" ; then + cat > $TMPC < +int main(void) { io_uring_queue_init(0, NULL, 0); io_uring_submit(NULL); r= eturn 0; } +EOF + if compile_prog "" "-luring" ; then + linux_io_uring=3Dyes + else + if test "$linux_io_uring" =3D "yes" ; then + feature_not_found "linux io_uring" "Install liburing" + fi + linux_io_uring=3Dno + fi +fi ########################################## # TPM emulation is only on POSIX @@ -6351,6 +6374,7 @@ echo "PIE $pie" echo "vde support $vde" echo "netmap support $netmap" echo "Linux AIO support $linux_aio" +echo "Linux io_uring support $linux_io_uring" echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" @@ -6831,6 +6855,9 @@ fi if test "$linux_aio" =3D "yes" ; then echo "CONFIG_LINUX_AIO=3Dy" >> $config_host_mak fi +if test "$linux_io_uring" =3D "yes" ; then + echo "CONFIG_LINUX_IO_URING=3Dy" >> $config_host_mak +fi if test "$attr" =3D "yes" ; then echo "CONFIG_ATTR=3Dy" >> $config_host_mak fi -- 2.17.1