Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp347315rwl; Fri, 4 Nov 2022 00:45:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7AADuoCofO3iBgjkXx8vcF+IBR5NJ9G8MrKRNAFnOxZ/DA0u3C62HCcKvRcDeNOwaaowY+ X-Received: by 2002:a63:2054:0:b0:46e:c21e:a43e with SMTP id r20-20020a632054000000b0046ec21ea43emr30674172pgm.113.1667547919505; Fri, 04 Nov 2022 00:45:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667547919; cv=none; d=google.com; s=arc-20160816; b=VFhA+q+DgD2d9vv91Z8PUYDixlSLL8bApEpa+sqIw22b3E2hxIGCBaQxBAHxfkWqBR btBljTrKQiHttNZX59/udRGIY6HBBbPnWFZ3Mt+gYloSEWqY5WLMxwTqg0v5kKLNlVyU QcCfWJdKe7B8fH6GonWJDRzstMKj4nkdxNoJhYgNyJoSmB+zFH586lzPb9x73GAvRnC/ b2BYRJBt/4r18N9SjmP4xzkPnxbt9+3TciQDsoQTdgvE/3u36J11Af4srvHyoVdHmPXe gGX4OtOFheug0hvgKCgaGhsYPFjdEgMaMt+uIrCzjAqFKIa5tLjnxCPbl4RWrpjYYtxu JQVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5Z8pgpEoQGeTMdYiqrUkF/Lckp8LaxoK9HC3TP6LmFk=; b=bgGu5pecJayWgXEtOLmbZ82IdACVJS/zdKSVzashCrwoTqIuRjk5Wi9jf358YLDpBF gyYTs8Oggnj2zmC4IDyjs07xlLBrZPHrb4GWJS5ASqm52WIlUZKYZ6OcL3yAqeNQaP/b bmXl7B03SQ/l6616dllTppZfWklsmgLmXOeCML1IRyvk/QQfqXmt514buBnb9H2QS0c7 S0CitChbFhB+VE3DWtXNELbEt3QOKCWMXmsRhs3fPt4TkrxwPbeeQEaTFoNPbWQrRbzu 2bMVDnnCOK84IRW+uqeiD6Yt1rweeF7cyK7tOGqzBvvW5MyxqrmQqBI6fA+7jE8b9MFA iwGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CiCw683j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg7-20020a17090b1e0700b0020ae29877besi2889382pjb.20.2022.11.04.00.45.07; Fri, 04 Nov 2022 00:45:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CiCw683j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbiKDG5H (ORCPT + 96 others); Fri, 4 Nov 2022 02:57:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231374AbiKDG5F (ORCPT ); Fri, 4 Nov 2022 02:57:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC911644E for ; Thu, 3 Nov 2022 23:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667544969; 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: in-reply-to:in-reply-to:references:references; bh=5Z8pgpEoQGeTMdYiqrUkF/Lckp8LaxoK9HC3TP6LmFk=; b=CiCw683jaHHCLBOp5W/xYdsLOeCM3e9x+DTXcDxYMTeC7re3kDLQhiCFC8JXDGLhcEqJ3Y ImuSGmteNOM4lA6pr8uPargqsNQxK1AB1JeepJV2xt7ClgLQyxlmAdB56KKe4t/n5IZIXd PIsTQLEcVCOaZRL8XuSr6ILa2Gs4Ros= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-584-tl7cLpKoOVqtVFLlNiUbrw-1; Fri, 04 Nov 2022 02:56:08 -0400 X-MC-Unique: tl7cLpKoOVqtVFLlNiUbrw-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-13b88262940so2202479fac.15 for ; Thu, 03 Nov 2022 23:56:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Z8pgpEoQGeTMdYiqrUkF/Lckp8LaxoK9HC3TP6LmFk=; b=Y0NAOySxnPum3EXsl5nSD4zLBnbutu/Aw9Aksj7az1wRAKY1x9xe3Y6yN3AV2NvqkZ MjL9Fh2IOykZRTfW8p4rPlRRBdz+IKLfi+rBR5mnELIVrQzYWXhxJ3gXShq9nFyqOi15 +yypFtk/tFXyJfGw5WPpDKziS1DBNHO7AtI/B26o4WaF2vicB4tlTThFzFSDoszWsoBG 5l0t3GAK3sudCJvXIR4UkDVJIbfQrWEd1RCyKak6GU/yA0sC6GdnlkcXliJ2jVP5vFAw 0afNnmafyKA1sZ2bgLfx3TtFmzBamBZM0dLHX2Efzi+57+H6sgWSjJmyx25MhPsOFOje SJbQ== X-Gm-Message-State: ACrzQf1FrgcVlCC4YzWv+NqGvcGk2qP1Gc/SPrAAUfrUGuIIdZTxr/KP ZM+zVlFW97JzZQ49ok5GE/y6W0ehTKshGSHyDX/FVLA9Emd0Rrmmxtll3pSd8uKOUTyjjlq7G1H 1ASatvQLtH/yU0+qm3UMSXDEaxhCkFXK8iz21+l0S X-Received: by 2002:a05:6870:9595:b0:132:7b3:29ac with SMTP id k21-20020a056870959500b0013207b329acmr187913oao.35.1667544967830; Thu, 03 Nov 2022 23:56:07 -0700 (PDT) X-Received: by 2002:a05:6870:9595:b0:132:7b3:29ac with SMTP id k21-20020a056870959500b0013207b329acmr187905oao.35.1667544967645; Thu, 03 Nov 2022 23:56:07 -0700 (PDT) MIME-Version: 1.0 References: <1d051d63-ce34-1bb3-2256-4ced4be6d690@redhat.com> In-Reply-To: From: Jason Wang Date: Fri, 4 Nov 2022 14:55:55 +0800 Message-ID: Subject: Re: ublk-qcow2: ublk-qcow2 is available To: Stefan Hajnoczi Cc: Stefan Hajnoczi , Yongji Xie , "Michael S. Tsirkin" , Ming Lei , Ziyang Zhang , io-uring@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel , "Denis V. Lunev" , Xiaoguang Wang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 3, 2022 at 3:13 AM Stefan Hajnoczi wrote: > > On Tue, Nov 01, 2022 at 10:36:29AM +0800, Jason Wang wrote: > > On Tue, Oct 25, 2022 at 8:02 PM Stefan Hajnoczi wr= ote: > > > > > > On Tue, 25 Oct 2022 at 04:17, Yongji Xie wr= ote: > > > > > > > > On Fri, Oct 21, 2022 at 2:30 PM Jason Wang wr= ote: > > > > > > > > > > > > > > > =E5=9C=A8 2022/10/21 13:33, Yongji Xie =E5=86=99=E9=81=93: > > > > > > On Tue, Oct 18, 2022 at 10:54 PM Stefan Hajnoczi wrote: > > > > > >> On Tue, 18 Oct 2022 at 09:17, Yongji Xie wrote: > > > > > >>> On Tue, Oct 18, 2022 at 2:59 PM Ming Lei wrote: > > > > > >>>> On Mon, Oct 17, 2022 at 07:11:59PM +0800, Yongji Xie wrote: > > > > > >>>>> On Fri, Oct 14, 2022 at 8:57 PM Ming Lei wrote: > > > > > >>>>>> On Thu, Oct 13, 2022 at 02:48:04PM +0800, Yongji Xie wrote= : > > > > > >>>>>>> On Wed, Oct 12, 2022 at 10:22 PM Stefan Hajnoczi wrote: > > > > > >>>>>>>> On Sat, 8 Oct 2022 at 04:43, Ziyang Zhang wrote: > > > > > >>>>>>>>> On 2022/10/5 12:18, Ming Lei wrote: > > > > > >>>>>>>>>> On Tue, Oct 04, 2022 at 09:53:32AM -0400, Stefan Hajno= czi wrote: > > > > > >>>>>>>>>>> On Tue, 4 Oct 2022 at 05:44, Ming Lei wrote: > > > > > >>>>>>>>>>>> On Mon, Oct 03, 2022 at 03:53:41PM -0400, Stefan Haj= noczi wrote: > > > > > >>>>>>>>>>>>> On Fri, Sep 30, 2022 at 05:24:11PM +0800, Ming Lei = wrote: > > > There are ways to minimize that cost: > > > 1. The driver only needs to fetch the device's sq index when it has > > > run out of sq ring space. > > > 2. The device can include sq index updates with completions. This is > > > what NVMe does with the CQE SQ Head Pointer field, but the > > > disadvantage is that the driver has no way of determining the sq inde= x > > > until a completion occurs. > > > > Probably, but as replied in another thread, based on the numbers > > measured from the networking test, I think the current virtio layout > > should be sufficient for block I/O but might not fit for cases like > > NFV. > > I remember that the Linux virtio_net driver doesn't rely on vq spinlocks > because CPU affinity and the NAPI architecture ensure that everything is > CPU-local. There is no need to protect the freelist explicitly because > the functions cannot race. > > Maybe virtio_blk can learn from virtio_net... It only works for RX where add and get could be all done in NAPI. But this is not the case for TX (and virtio-blk). Actually, if the free_list is the one thing that needs to be serialized, there's no need to use lock at all. We can try to switch to use ptr_ring instead. Thanks > > Stefan