Re: [PATCH 0/6][RFC] virtio-blk: Change I/O path from request toBIO

From: Paolo Bonzini
Date: Mon Jan 02 2012 - 11:12:14 EST


On 01/01/2012 05:45 PM, Stefan Hajnoczi wrote:
By the way, drivers for solid-state devices can set QUEUE_FLAG_NONROT
to hint that seek time optimizations may be sub-optimal. NBD and
other virtual/pseudo device drivers set this flag. Should virtio-blk
set it and how does it affect performance?

By itself is not a good idea in general.

When QEMU uses O_DIRECT, the guest should not use QUEUE_FLAG_NONROT unless it is active for the host disk as well. (In doubt, as is the case for remote hosts accessed over NFS, I would also avoid NONROT and allow more coalescing).

When QEMU doesn't use O_DIRECT, instead, using QUEUE_FLAG_NONROT and leaving optimizations to the host may make some sense.

In Xen, the back-end driver is bio-based, so the scenario is like QEMU with O_DIRECT. I remember seeing worse performance when switching the front-end to either QUEUE_FLAG_NONROT or the noop scheduler. This was with RHEL5 (2.6.18), but it might still be true in more recent kernels, modulo benchmarking of course. Still, the current in-tree xen-blkfront driver does use QUEUE_FLAG_NONROT unconditionally, more precisely its synonym QUEUE_FLAG_VIRT.

Still, if benchmarking confirms this theory, QEMU could expose a hint via a feature bit. The default could be simply "use QUEUE_FLAG_NONROT iff not using O_DIRECT", or it could be more complicated with help from sysfs.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/