Virtualization Archive on lore.kernel.org
 help / color / Atom feed
* Re: Interesting qemu/virt-manager bug about the "rotational" attribute on virtio-blk disks
       [not found] <20200716080614.GA18456@redhat.com>
@ 2020-07-16  9:33 ` Stefano Garzarella
  2020-07-23 10:32   ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Garzarella @ 2020-07-16  9:33 UTC (permalink / raw)
  To: Richard W.M. Jones
  Cc: Michael S. Tsirkin, virtualization, Stefan Hajnoczi, qemu-discuss

+Cc Michael, Stefan, virtualization@lists.linux-foundation.org

On Thu, Jul 16, 2020 at 09:06:14AM +0100, Richard W.M. Jones wrote:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1857515
> 
> A virtio-blk disk which is backed by a raw file on an SSD,
> inside the guest shows rotational = 1.
> 
> I assumed that qemu must have a "rotational" property for disks and
> this would be communicated by virtio to the guest, but qemu and virtio
> don't seem to have this.  Pretty surprising!  Is it called something
> other than "rotational"?
> 

I'm not sure if we need to add this property in QEMU, but in Linux
I found these flags (include/linux/blkdev.h) for the block queues:

    #define QUEUE_FLAG_NONROT	6	/* non-rotational device (SSD) */
    #define QUEUE_FLAG_VIRT		QUEUE_FLAG_NONROT /* paravirt device */

xen-blkfront driver is the only one that sets the QUEUE_FLAG_VIRT,
should we do the same in the virtio-blk driver regardless of the backend?

Thanks,
Stefano

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Interesting qemu/virt-manager bug about the "rotational" attribute on virtio-blk disks
  2020-07-16  9:33 ` Interesting qemu/virt-manager bug about the "rotational" attribute on virtio-blk disks Stefano Garzarella
@ 2020-07-23 10:32   ` Stefan Hajnoczi
  2020-07-23 10:40     ` Richard W.M. Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2020-07-23 10:32 UTC (permalink / raw)
  To: Stefano Garzarella; +Cc: Michael S. Tsirkin, virtualization, qemu-discuss

[-- Attachment #1.1: Type: text/plain, Size: 1754 bytes --]

On Thu, Jul 16, 2020 at 11:33:44AM +0200, Stefano Garzarella wrote:
> +Cc Michael, Stefan, virtualization@lists.linux-foundation.org
> 
> On Thu, Jul 16, 2020 at 09:06:14AM +0100, Richard W.M. Jones wrote:
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1857515
> > 
> > A virtio-blk disk which is backed by a raw file on an SSD,
> > inside the guest shows rotational = 1.
> > 
> > I assumed that qemu must have a "rotational" property for disks and
> > this would be communicated by virtio to the guest, but qemu and virtio
> > don't seem to have this.  Pretty surprising!  Is it called something
> > other than "rotational"?
> > 
> 
> I'm not sure if we need to add this property in QEMU, but in Linux
> I found these flags (include/linux/blkdev.h) for the block queues:
> 
>     #define QUEUE_FLAG_NONROT	6	/* non-rotational device (SSD) */
>     #define QUEUE_FLAG_VIRT		QUEUE_FLAG_NONROT /* paravirt device */
> 
> xen-blkfront driver is the only one that sets the QUEUE_FLAG_VIRT,
> should we do the same in the virtio-blk driver regardless of the backend?

The ability to control this flag would be interesting for performance
experiments.

The problem with changing the default is that regressions can be
expected. Certain workloads benefit while others regress.

I suggest:
1. Make it controllable so that QUEUE_FLAG_NONROT can be set or clear
   (not hardcoded to a single value).
2. The device can communicate the optimal setting from the host. The
   SCSI protocol already conveys this information. Virtio-blk needs a
   feature bit and possibly config space field.
3. Make it migration-safe. It needs to be configured explicitly so the
   value doesn't change suddenly across migration.

Stefan

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Interesting qemu/virt-manager bug about the "rotational" attribute on virtio-blk disks
  2020-07-23 10:32   ` Stefan Hajnoczi
@ 2020-07-23 10:40     ` Richard W.M. Jones
  2020-07-23 11:15       ` Stefano Garzarella
  0 siblings, 1 reply; 4+ messages in thread
From: Richard W.M. Jones @ 2020-07-23 10:40 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-discuss, Michael S. Tsirkin, virtualization

On Thu, Jul 23, 2020 at 11:32:39AM +0100, Stefan Hajnoczi wrote:
> On Thu, Jul 16, 2020 at 11:33:44AM +0200, Stefano Garzarella wrote:
> > +Cc Michael, Stefan, virtualization@lists.linux-foundation.org
> > 
> > On Thu, Jul 16, 2020 at 09:06:14AM +0100, Richard W.M. Jones wrote:
> > > 
> > > https://bugzilla.redhat.com/show_bug.cgi?id=1857515
> > > 
> > > A virtio-blk disk which is backed by a raw file on an SSD,
> > > inside the guest shows rotational = 1.
> > > 
> > > I assumed that qemu must have a "rotational" property for disks and
> > > this would be communicated by virtio to the guest, but qemu and virtio
> > > don't seem to have this.  Pretty surprising!  Is it called something
> > > other than "rotational"?
> > > 
> > 
> > I'm not sure if we need to add this property in QEMU, but in Linux
> > I found these flags (include/linux/blkdev.h) for the block queues:
> > 
> >     #define QUEUE_FLAG_NONROT	6	/* non-rotational device (SSD) */
> >     #define QUEUE_FLAG_VIRT		QUEUE_FLAG_NONROT /* paravirt device */
> > 
> > xen-blkfront driver is the only one that sets the QUEUE_FLAG_VIRT,
> > should we do the same in the virtio-blk driver regardless of the backend?
> 
> The ability to control this flag would be interesting for performance
> experiments.

I expect there's a pretty strong interaction between this feature and
the shared guest io_uring stuff isn't there?  I'm not sure if it'll be
a positive or negative effect though.

Rich.

> The problem with changing the default is that regressions can be
> expected. Certain workloads benefit while others regress.
> 
> I suggest:
> 1. Make it controllable so that QUEUE_FLAG_NONROT can be set or clear
>    (not hardcoded to a single value).
> 2. The device can communicate the optimal setting from the host. The
>    SCSI protocol already conveys this information. Virtio-blk needs a
>    feature bit and possibly config space field.
> 3. Make it migration-safe. It needs to be configured explicitly so the
>    value doesn't change suddenly across migration.
> 
> Stefan



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Interesting qemu/virt-manager bug about the "rotational" attribute on virtio-blk disks
  2020-07-23 10:40     ` Richard W.M. Jones
@ 2020-07-23 11:15       ` Stefano Garzarella
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Garzarella @ 2020-07-23 11:15 UTC (permalink / raw)
  To: Richard W.M. Jones, Stefan Hajnoczi
  Cc: Michael S. Tsirkin, virtualization, qemu-discuss

On Thu, Jul 23, 2020 at 11:40:56AM +0100, Richard W.M. Jones wrote:
> On Thu, Jul 23, 2020 at 11:32:39AM +0100, Stefan Hajnoczi wrote:
> > On Thu, Jul 16, 2020 at 11:33:44AM +0200, Stefano Garzarella wrote:
> > > +Cc Michael, Stefan, virtualization@lists.linux-foundation.org
> > > 
> > > On Thu, Jul 16, 2020 at 09:06:14AM +0100, Richard W.M. Jones wrote:
> > > > 
> > > > https://bugzilla.redhat.com/show_bug.cgi?id=1857515
> > > > 
> > > > A virtio-blk disk which is backed by a raw file on an SSD,
> > > > inside the guest shows rotational = 1.
> > > > 
> > > > I assumed that qemu must have a "rotational" property for disks and
> > > > this would be communicated by virtio to the guest, but qemu and virtio
> > > > don't seem to have this.  Pretty surprising!  Is it called something
> > > > other than "rotational"?
> > > > 
> > > 
> > > I'm not sure if we need to add this property in QEMU, but in Linux
> > > I found these flags (include/linux/blkdev.h) for the block queues:
> > > 
> > >     #define QUEUE_FLAG_NONROT	6	/* non-rotational device (SSD) */
> > >     #define QUEUE_FLAG_VIRT		QUEUE_FLAG_NONROT /* paravirt device */
> > > 
> > > xen-blkfront driver is the only one that sets the QUEUE_FLAG_VIRT,
> > > should we do the same in the virtio-blk driver regardless of the backend?
> > 
> > The ability to control this flag would be interesting for performance
> > experiments.
> 
> I expect there's a pretty strong interaction between this feature and
> the shared guest io_uring stuff isn't there?  I'm not sure if it'll be
> a positive or negative effect though.

Yeah, it could be! I'll try it out in the next days.

> 
> Rich.
> 
> > The problem with changing the default is that regressions can be
> > expected. Certain workloads benefit while others regress.
> > 
> > I suggest:
> > 1. Make it controllable so that QUEUE_FLAG_NONROT can be set or clear
> >    (not hardcoded to a single value).
> > 2. The device can communicate the optimal setting from the host. The
> >    SCSI protocol already conveys this information. Virtio-blk needs a
> >    feature bit and possibly config space field.
> > 3. Make it migration-safe. It needs to be configured explicitly so the
> >    value doesn't change suddenly across migration.

Thanks for the suggestions.

I'll spend some time on this.

Stefano

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200716080614.GA18456@redhat.com>
2020-07-16  9:33 ` Interesting qemu/virt-manager bug about the "rotational" attribute on virtio-blk disks Stefano Garzarella
2020-07-23 10:32   ` Stefan Hajnoczi
2020-07-23 10:40     ` Richard W.M. Jones
2020-07-23 11:15       ` Stefano Garzarella

Virtualization Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/virtualization/0 virtualization/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 virtualization virtualization/ https://lore.kernel.org/virtualization \
		virtualization@lists.linuxfoundation.org
	public-inbox-index virtualization

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxfoundation.lists.virtualization


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git