* Re: [PATCH] virtio_blk: make virtio blks as non-rotational devices
[not found] <20210326033914.65483-1-jiangxiaoqing.sochin@bytedance.com>
@ 2021-03-29 16:23 ` Stefan Hajnoczi
0 siblings, 0 replies; only message in thread
From: Stefan Hajnoczi @ 2021-03-29 16:23 UTC (permalink / raw)
To: Sochin Jiang
Cc: mst, jasowang, pbonzini, lizefan.x, linux-kernel, Christoph Hellwig
[-- Attachment #1: Type: text/plain, Size: 1583 bytes --]
On Fri, Mar 26, 2021 at 11:39:13AM +0800, Sochin Jiang wrote:
> This confuses some users seeing one rotational block device
> in the guest(/sys/block/vdx/queue/rotational), let's make
> virtio blks as virtual block devices, just like xen blks,
> and as we known, QUEUE_FLAG_VIRT is defined as QUEUE_FLAG_NONROT
> actually. See also rbd and nbd block devices.
>
> Signed-off-by: Sochin Jiang <jiangxiaoqing.sochin@bytedance.com>
> ---
> drivers/block/virtio_blk.c | 1 +
> 1 file changed, 1 insertion(+)
I would like to make this change because it seems consistent and often
the disk really is non-rotational. However, a justification and
performance results are needed especially since this has been reverted
previously. Please see commit f8b12e513b953aebf30f8ff7d2de9be7e024dbbe
("virtio_blk: revert QUEUE_FLAG_VIRT addition").
That was in 2009, so maybe things have changed now. Please explain what
has changed in the commit description.
This flag can affect performance. Please include performance data.
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index b9fa3ef5b57c..31a978a4dab5 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -822,6 +822,7 @@ static int virtblk_probe(struct virtio_device *vdev)
> max_size = min(max_size, v);
>
> blk_queue_max_segment_size(q, max_size);
> + blk_queue_flag_set(QUEUE_FLAG_VIRT, q);
>
> /* Host can optionally specify the block size of the device */
> err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> --
> 2.11.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-29 16:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210326033914.65483-1-jiangxiaoqing.sochin@bytedance.com>
2021-03-29 16:23 ` [PATCH] virtio_blk: make virtio blks as non-rotational devices Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).