From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3D0EC433FE for ; Tue, 22 Feb 2022 15:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232878AbiBVPER (ORCPT ); Tue, 22 Feb 2022 10:04:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233274AbiBVPEJ (ORCPT ); Tue, 22 Feb 2022 10:04:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D198910EC64 for ; Tue, 22 Feb 2022 07:03:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 53E9D6152E for ; Tue, 22 Feb 2022 15:03:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE1CC340E8; Tue, 22 Feb 2022 15:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645542218; bh=sF29agGyHsX8Udu48FPCpvs/QyXfpzPgjgx5kraSddQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f3dsrr0hoHdYTBf6UbJFOKQ+S+xQzLXMxVRXUzG1yPzzaz8CIqigtGy7weXYheNW+ ha4/yrxPLMPW5w0NsBZ66wlB5D9/zq7n+hKDbBmT+HudU2/6lxUryeSUbFuB9p4T8D 3euJoh+8xmA7a102HjWhUks7/FPGlzMArzkyTIPJFd5e4ha05TcBRKOSHje+57a1Be aaGXMV5b9+UcoVPx5Xq+3tySqxTuEofCjivfWck2TwmmjtLF/ltpRH8EqmI9cKCbpu y9RGo2LpA6XLf3XyhEkS3VK3fjDIh07KqFwThMwLoWoIcnziACpri9Ar450kvLj5Lv hqJtwdE2TGvZQ== Date: Tue, 22 Feb 2022 07:03:35 -0800 From: Keith Busch To: Stefan Hajnoczi Cc: Klaus Jensen , qemu-devel , kvm , Rust-VMM Mailing List , Damien Le Moal , Gerd Hoffmann , Sergio Lopez , Dmitry Fomichev , Alex =?iso-8859-1?Q?Benn=E9e?= , Hannes Reinecke , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , "Florescu, Andreea" , Hanna Reitz , Alex Agache , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Paolo Bonzini , John Snow , Stefano Garzarella Subject: Re: Call for GSoC and Outreachy project ideas for summer 2022 Message-ID: <20220222150335.GA1497257@dhcp-10-100-145-180.wdc.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Feb 22, 2022 at 09:48:06AM +0000, Stefan Hajnoczi wrote: > On Mon, 21 Feb 2022 at 12:00, Klaus Jensen wrote: > > > > Yes, I'll go ahead as mentor for this. > > > > @Keith, if you want to join in, let us know :) Thank you for setting this up, I would be happy assist with the cause! > > Suggested updated summary: > > > > QEMU's NVMe emulation uses the traditional trap-and-emulation method to > > emulate I/Os, thus the performance suffers due to frequent VM-exits. > > Version 1.3 of the NVMe specification defines a new feature to update > > doorbell registers using a Shadow Doorbell Buffer. This can be utilized > > to enhance performance of emulated controllers by reducing the number of > > Submission Queue Tail Doorbell writes. > > > > Further more, it is possible to run emulation in a dedicated thread > > called an IOThread. Emulating NVMe in a separate thread allows the vcpu > > thread to continue execution and results in better performance. > > > > Finally, it is possible for the emulation code to watch for changes to > > the queue memory instead of waiting for doorbell writes. This technique > > is called polling and reduces notification latency at the expense of an > > another thread consuming CPU to detect queue activity. > > > > The goal of this project is to add implement these optimizations so > > QEMU's NVMe emulation performance becomes comparable to virtio-blk > > performance. > > > > Tasks include: > > > > Add Shadow Doorbell Buffer support to reduce doorbell writes > > Add Submission Queue polling > > Add IOThread support so emulation can run in a dedicated thread > > > > Maybe add a link to this previous discussion as well: > > > > https://lore.kernel.org/qemu-devel/1447825624-17011-1-git-send-email-mlin@kernel.org/T/#u > > Great, I have added the project idea. I left in the sq doorbell > ioeventfd task but moved it after the Shadow Doorbell Buffer support > task and made it clear that the ioeventfd can only be used when the > Shadow Doorbell Buffer is enabled: > https://wiki.qemu.org/Google_Summer_of_Code_2022#NVMe_Emulation_Performance_Optimization Looks great, this seems like a very useful addition to have. I like that the feature can be broken down into two parts. Hopefully that makes it more approachable. From mboxrd@z Thu Jan 1 00:00:00 1970 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 7B7C3C433F5 for ; Tue, 22 Feb 2022 15:59:27 +0000 (UTC) Received: from localhost ([::1]:33676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMXZW-0004w4-CY for qemu-devel@archiver.kernel.org; Tue, 22 Feb 2022 10:59:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMWhh-00062k-H8 for qemu-devel@nongnu.org; Tue, 22 Feb 2022 10:03:49 -0500 Received: from [2604:1380:4641:c500::1] (port=48712 helo=dfw.source.kernel.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMWhf-0001Dx-0F for qemu-devel@nongnu.org; Tue, 22 Feb 2022 10:03:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E0B3861589; Tue, 22 Feb 2022 15:03:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE1CC340E8; Tue, 22 Feb 2022 15:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645542218; bh=sF29agGyHsX8Udu48FPCpvs/QyXfpzPgjgx5kraSddQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f3dsrr0hoHdYTBf6UbJFOKQ+S+xQzLXMxVRXUzG1yPzzaz8CIqigtGy7weXYheNW+ ha4/yrxPLMPW5w0NsBZ66wlB5D9/zq7n+hKDbBmT+HudU2/6lxUryeSUbFuB9p4T8D 3euJoh+8xmA7a102HjWhUks7/FPGlzMArzkyTIPJFd5e4ha05TcBRKOSHje+57a1Be aaGXMV5b9+UcoVPx5Xq+3tySqxTuEofCjivfWck2TwmmjtLF/ltpRH8EqmI9cKCbpu y9RGo2LpA6XLf3XyhEkS3VK3fjDIh07KqFwThMwLoWoIcnziACpri9Ar450kvLj5Lv hqJtwdE2TGvZQ== Date: Tue, 22 Feb 2022 07:03:35 -0800 From: Keith Busch To: Stefan Hajnoczi Subject: Re: Call for GSoC and Outreachy project ideas for summer 2022 Message-ID: <20220222150335.GA1497257@dhcp-10-100-145-180.wdc.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2604:1380:4641:c500::1 (failed) Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=kbusch@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -63 X-Spam_score: -6.4 X-Spam_bar: ------ X-Spam_report: (-6.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Le Moal , Sergio Lopez , kvm , Dmitry Fomichev , John Snow , Alex Agache , qemu-devel , "Florescu, Andreea" , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , Hanna Reitz , Paolo Bonzini , Gerd Hoffmann , Rust-VMM Mailing List , Klaus Jensen , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Stefano Garzarella , Alex =?iso-8859-1?Q?Benn=E9e?= , Hannes Reinecke Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Feb 22, 2022 at 09:48:06AM +0000, Stefan Hajnoczi wrote: > On Mon, 21 Feb 2022 at 12:00, Klaus Jensen wrote: > > > > Yes, I'll go ahead as mentor for this. > > > > @Keith, if you want to join in, let us know :) Thank you for setting this up, I would be happy assist with the cause! > > Suggested updated summary: > > > > QEMU's NVMe emulation uses the traditional trap-and-emulation method to > > emulate I/Os, thus the performance suffers due to frequent VM-exits. > > Version 1.3 of the NVMe specification defines a new feature to update > > doorbell registers using a Shadow Doorbell Buffer. This can be utilized > > to enhance performance of emulated controllers by reducing the number of > > Submission Queue Tail Doorbell writes. > > > > Further more, it is possible to run emulation in a dedicated thread > > called an IOThread. Emulating NVMe in a separate thread allows the vcpu > > thread to continue execution and results in better performance. > > > > Finally, it is possible for the emulation code to watch for changes to > > the queue memory instead of waiting for doorbell writes. This technique > > is called polling and reduces notification latency at the expense of an > > another thread consuming CPU to detect queue activity. > > > > The goal of this project is to add implement these optimizations so > > QEMU's NVMe emulation performance becomes comparable to virtio-blk > > performance. > > > > Tasks include: > > > > Add Shadow Doorbell Buffer support to reduce doorbell writes > > Add Submission Queue polling > > Add IOThread support so emulation can run in a dedicated thread > > > > Maybe add a link to this previous discussion as well: > > > > https://lore.kernel.org/qemu-devel/1447825624-17011-1-git-send-email-mlin@kernel.org/T/#u > > Great, I have added the project idea. I left in the sq doorbell > ioeventfd task but moved it after the Shadow Doorbell Buffer support > task and made it clear that the ioeventfd can only be used when the > Shadow Doorbell Buffer is enabled: > https://wiki.qemu.org/Google_Summer_of_Code_2022#NVMe_Emulation_Performance_Optimization Looks great, this seems like a very useful addition to have. I like that the feature can be broken down into two parts. Hopefully that makes it more approachable.