mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Sochin Jiang <jiangxiaoqing.sochin@bytedance.com>
Cc: mst@redhat.com, jasowang@redhat.com, pbonzini@redhat.com,
	lizefan.x@bytedance.com, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] virtio_blk: make virtio blks as non-rotational devices
Date: Mon, 29 Mar 2021 17:23:20 +0100	[thread overview]
Message-ID: <YGH++CMejgUlvBy1@stefanha-x1.localdomain> (raw)
In-Reply-To: <20210326033914.65483-1-jiangxiaoqing.sochin@bytedance.com>

[-- 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 --]

           reply	other threads:[~2021-03-29 16:24 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20210326033914.65483-1-jiangxiaoqing.sochin@bytedance.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YGH++CMejgUlvBy1@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=hch@infradead.org \
    --cc=jasowang@redhat.com \
    --cc=jiangxiaoqing.sochin@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®