Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1706550rdb; Thu, 7 Dec 2023 06:52:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFspTgORtjvcgqAggI2P7tCyVzQeJfiI6hizNZyzE9gfWlkZZhEEVmeFh9G50K99DrtSdjq X-Received: by 2002:a17:902:ced2:b0:1d0:9a64:e511 with SMTP id d18-20020a170902ced200b001d09a64e511mr2733914plg.73.1701960745971; Thu, 07 Dec 2023 06:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701960745; cv=none; d=google.com; s=arc-20160816; b=JdO2VzA+1ejy3k2xFFAXMwzO9WODbKdxkSONgqyLgevylUlVNTRXZW0NOYdDpShmFF lLcVnsC36M//kxbqKtMJSRO66QY9ypYGKovSlw84zzqZxhIL569VKaBCczlIIVSyK2h2 TWPtxEAKcl2Tv+ZJpDZI/5XRjf/yWa5OGBuNPng9JCXvFQL4kJe9em5zuBOy9wnCemec Nh3sPKhNjSsFoB7fDoFamN3EZmfEMV0XHw2CkkTV3xu2DZ0BLMHi5aZNiWEK/lLz/e/F uIfhiEnGjEk+4iSadXOzuOIkCe2pKkcOPwiBdBgG7FBo+UZHJgV+0TmnXCCMBAFKBfNC qSQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V0xpo2ryVhd+3GXnE5ml+fwWQScftYbSzd+a1VvBh0k=; fh=aLJrw1Od9CxbVsEVw0URrenfhrLW812a1n0VsAYOa4k=; b=hCdeHSlAMch+ohnLzb16fRJqaL6inhpTxMszyl7vfgJ6/jJJRfMULi0S3PT502PT4c Iex6nmRuHppn3UKkvMQzCxR+OsosTOvHsv+3OPAa0E7vzAqCGL0FyT2IB5/54QwP9TKF 9WXAySg1Tg1w/o77BsOhPGLFaPzfhGaARFjRPURcl9kyrVVyo6UV+XnqBnlhkaX8844s fZzRyQYv+qmfsbCLS80OVSW49F5FPJD1f9OMqdkaBICTkUhpsTGJ+V/m11lPYd4e3QV8 aEIk5uPukbNPtjSKyyJqNDHjadnjCf+YZmd6KB4nufIi6tpVQWB7HNjcwB7r5dfJfk03 IvOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZIsAWQkN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l4-20020a17090a72c400b002868cf02685si1161520pjk.167.2023.12.07.06.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:52:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZIsAWQkN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5FF458023777; Thu, 7 Dec 2023 06:52:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443420AbjLGOwI (ORCPT + 99 others); Thu, 7 Dec 2023 09:52:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443322AbjLGOwI (ORCPT ); Thu, 7 Dec 2023 09:52:08 -0500 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 75E0AC3 for ; Thu, 7 Dec 2023 06:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701960733; 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: in-reply-to:in-reply-to:references:references; bh=V0xpo2ryVhd+3GXnE5ml+fwWQScftYbSzd+a1VvBh0k=; b=ZIsAWQkN/r4V5myrrscFAcTKjf9MocjekZQs/veywNJyn7xA4y5RvKaRthA2nvjsydItUY iFwzxXkpdaGaUO8Pf3nr+96NJlFHIdrOveifEuWg+14E1dNdGc9kHL15HAhVBn7Taul9+7 AQuGBaVJ6JcDf3v2ueJdT2RQ7uyEd+Q= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-2V5E8xUnMuWEVomgn9XDhg-1; Thu, 07 Dec 2023 09:52:08 -0500 X-MC-Unique: 2V5E8xUnMuWEVomgn9XDhg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DCC7E1C01724; Thu, 7 Dec 2023 14:52:07 +0000 (UTC) Received: from localhost (unknown [10.39.193.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 205F1492BE6; Thu, 7 Dec 2023 14:52:06 +0000 (UTC) Date: Thu, 7 Dec 2023 09:51:59 -0500 From: Stefan Hajnoczi To: Li Feng Cc: Jens Axboe , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Xuan Zhuo , "open list:BLOCK LAYER" , open list , "open list:VIRTIO BLOCK AND SCSI DRIVERS" , Christoph Hellwig Subject: Re: [PATCH] virtio_blk: set the default scheduler to none Message-ID: <20231207145159.GB2147383@fedora> References: <20231207043118.118158-1-fengli@smartx.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jzahsJkBdAiW+nf1" Content-Disposition: inline In-Reply-To: <20231207043118.118158-1-fengli@smartx.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:52:23 -0800 (PST) --jzahsJkBdAiW+nf1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 07, 2023 at 12:31:05PM +0800, Li Feng wrote: > virtio-blk is generally used in cloud computing scenarios, where the > performance of virtual disks is very important. The mq-deadline scheduler > has a big performance drop compared to none with single queue. In my test= s, > mq-deadline 4k readread iops were 270k compared to 450k for none. So here > the default scheduler of virtio-blk is set to "none". >=20 > Signed-off-by: Li Feng > --- > drivers/block/virtio_blk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This seems similar to commit f8b12e513b95 ("virtio_blk: revert QUEUE_FLAG_VIRT addition") where changing the default sounded good in theory but exposed existing users to performance regressions. Christoph's suggestion back in 2009 was to introduce a flag in the virtio-blk hardware interface so that the device can provide a hint from the host side. Do you have more performance data aside from 4k randread? My suggestion would be for everyone with an interest to collect and share data so there's more evidence that this new default works well for a range of configurations. I don't want to be overly conservative. The virtio_blk driver has undergone changes in this regard from the legacy block layer to blk-mq (without an I/O scheduler) to blk-mq (mq-deadline). Performance changed at each step and that wasn't a showstopper, so I think we could default to 'none' without a lot of damage. Let's just get more data. Stefan >=20 > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > index d53d6aa8ee69..5183ec8e00be 100644 > --- a/drivers/block/virtio_blk.c > +++ b/drivers/block/virtio_blk.c > @@ -1367,7 +1367,7 @@ static int virtblk_probe(struct virtio_device *vdev) > vblk->tag_set.ops =3D &virtio_mq_ops; > vblk->tag_set.queue_depth =3D queue_depth; > vblk->tag_set.numa_node =3D NUMA_NO_NODE; > - vblk->tag_set.flags =3D BLK_MQ_F_SHOULD_MERGE; > + vblk->tag_set.flags =3D BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_NO_SCHED_BY_DE= FAULT; > vblk->tag_set.cmd_size =3D > sizeof(struct virtblk_req) + > sizeof(struct scatterlist) * VIRTIO_BLK_INLINE_SG_CNT; > --=20 > 2.42.0 >=20 --jzahsJkBdAiW+nf1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmVx3A8ACgkQnKSrs4Gr c8iW7Af/SwZCn/GpSj7j9V527PVV437hXYHQ04RyKzmI6js4NU3gfzqaV/hqy4O4 LMD9gAUovQGx9OhvYRtCkpEw+gLhn51wwUxNYX77y3eaHGEyxb4btN0DetBu3LDp Rz4caz4YiFMxFcSB9yHt84Q/noT97Iy4lar3xNiy8OEOdleVKGhuv351zvwdMnJ5 lBiP9yNaSUgapXJbD6nAmrt765aR3ByQInkS/kxjLURF4gFQKlx76kUcFlC7FquV +Pwk1QQr1tT8vfKCzYm8YeDl8tNecPEm+N3gtnAbMv+1dAtnI+7b4P8K3+GPiE7d 6Ze512aHSeonNEi6hUqQpiUb2ae2pw== =FsbK -----END PGP SIGNATURE----- --jzahsJkBdAiW+nf1--