From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67D2EC13C;
	Mon, 16 Dec 2024 02:01:30 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.98
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1734314494; cv=none; b=NDoGUDjztbPZxTqm2lGC0sWxbJJFm3O5pOTTl5bnCmjRPKSHUmrBAiVpBpQjnz+0v08SUoecOih+Yvj1u6lsqIWiErWuebonf6XczRX35INnl0uIdYeTMSPqQBhnvIuNLGhp6IujEJp+NI4ASZ6SlfWY5zLJ+yIJPqXByele5oA=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1734314494; c=relaxed/simple;
	bh=jy6JeXs2Y4N4FEgapoAuxphq3YytVmsqFHhFWkE4yrs=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=mqV2LlATHwWkgf48dpHT4oT1nszGzciP9GTQQsjqZ4TlcELW0WEELmnOy+uSJR5mR5BGqLZ9D8InhelX8HCxVSsxNyKLSWg5O24VhKqk/mdqexbwhXU+tiOJpEFQweDGNnAKqoPsqXdQRVyPwljZo9hd8z7lvnkrfLJ2+0WhmOM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=ACE5nSmM; arc=none smtp.client-ip=115.124.30.98
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="ACE5nSmM"
DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=linux.alibaba.com; s=default;
	t=1734314483; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type;
	bh=Uzhd86AP6M1PVIFrrHesQFgI9H7FZF3bFho2hW5Z7uI=;
	b=ACE5nSmMAKL4JbL4EcIrrCvUUtrI/dedKF+czL8EMpArIF6Q8ndanIhE294OtTLEtbFtS3E9CmCld+4x+tFGuPYJDLxZ6SkSDqhliPBPimOQr+3LGSo8vAqKT4Nq6T1kTo23fk16Uek7++nR/nIZa8uNtsilMkAS1JGlPylCGf0=
Received: from 30.221.131.67(mailfrom:mengferry@linux.alibaba.com fp:SMTPD_---0WLVCjR4_1734314481 cluster:ay36)
          by smtp.aliyun-inc.com;
          Mon, 16 Dec 2024 10:01:22 +0800
Message-ID: <2d4ad724-f9da-4502-9079-432935f5719d@linux.alibaba.com>
Date: Mon, 16 Dec 2024 10:01:21 +0800
Precedence: bulk
X-Mailing-List: io-uring@vger.kernel.org
List-Id: <io-uring.vger.kernel.org>
List-Subscribe: <mailto:io-uring+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:io-uring+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3][RFC] virtio-blk: add io_uring passthrough support for
 virtio-blk
To: "Michael S . Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>,
 linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
 virtualization@lists.linux.dev
Cc: linux-kernel@vger.kernel.org, io-uring@vger.kernel.org,
 Joseph Qi <joseph.qi@linux.alibaba.com>,
 Jeffle Xu <jefflexu@linux.alibaba.com>
References: <20241203121424.19887-1-mengferry@linux.alibaba.com>
Content-Language: en-US
From: Ferry Meng <mengferry@linux.alibaba.com>
In-Reply-To: <20241203121424.19887-1-mengferry@linux.alibaba.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit


On 12/3/24 8:14 PM, Ferry Meng wrote:
> We seek to develop a more flexible way to use virtio-blk and bypass the block
> layer logic in order to accomplish certain performance optimizations. As a
> result, we referred to the implementation of io_uring passthrough in NVMe
> and implemented it in the virtio-blk driver. This patch series adds io_uring
> passthrough support for virtio-blk devices, resulting in lower submit latency
> and increased flexibility when utilizing virtio-blk.
>
> To test this patch series, I changed fio's code:
> 1. Added virtio-blk support to engines/io_uring.c.
> 2. Added virtio-blk support to the t/io_uring.c testing tool.
> Link: https://github.com/jdmfr/fio
>
> Using t/io_uring-vblk, the performance of virtio-blk based on uring-cmd
> scales better than block device access. (such as below, Virtio-Blk with QEMU,
> 1-depth fio)
> (passthru) read: IOPS=17.2k, BW=67.4MiB/s (70.6MB/s)
> slat (nsec): min=2907, max=43592, avg=3981.87, stdev=595.10
> clat (usec): min=38, max=285,avg=53.47, stdev= 8.28
> lat (usec): min=44, max=288, avg=57.45, stdev= 8.28
> (block) read: IOPS=15.3k, BW=59.8MiB/s (62.7MB/s)
> slat (nsec): min=3408, max=35366, avg=5102.17, stdev=790.79
> clat (usec): min=35, max=343, avg=59.63, stdev=10.26
> lat (usec): min=43, max=349, avg=64.73, stdev=10.21
>
> Testing the virtio-blk device with fio using 'engines=io_uring_cmd'
> and 'engines=io_uring' also demonstrates improvements in submit latency.
> (passthru) taskset -c 0 t/io_uring-vblk -b4096 -d8 -c4 -s4 -p0 -F1 -B0 -O0 -n1 -u1 /dev/vdcc0
> IOPS=189.80K, BW=741MiB/s, IOS/call=4/3
> IOPS=187.68K, BW=733MiB/s, IOS/call=4/3
> (block) taskset -c 0 t/io_uring-vblk -b4096 -d8 -c4 -s4 -p0 -F1 -B0 -O0 -n1 -u0 /dev/vdc
> IOPS=101.51K, BW=396MiB/s, IOS/call=4/3
> IOPS=100.01K, BW=390MiB/s, IOS/call=4/4
>
> The performance overhead of submitting IO can be decreased by 25% overall
> with this patch series. The implementation primarily references 'nvme io_uring
> passthrough', supporting io_uring_cmd through a separate character interface
> (temporarily named /dev/vdXc0). Since this is an early version, many
> details need to be taken into account and redesigned, like:
> ● Currently, it only considers READ/WRITE scenarios, some more complex operations
> not included like discard or zone ops.(Normal sqe64 is sufficient, in my opinion;
> following upgrades, sqe128 and cqe32 might not be needed).
> ● ......
>
> I would appreciate any useful recommendations.
>
> Ferry Meng (3):
>    virtio-blk: add virtio-blk chardev support.
>    virtio-blk: add uring_cmd support for I/O passthru on chardev.
>    virtio-blk: add uring_cmd iopoll support.
>
>   drivers/block/virtio_blk.c      | 325 +++++++++++++++++++++++++++++++-
>   include/uapi/linux/virtio_blk.h |  16 ++
>   2 files changed, 336 insertions(+), 5 deletions(-)

Hi, Micheal & Jason :

What about yours' opinion? As virtio-blk maintainer. Looking forward to 
your reply.

Thanks