Stefan Hajnoczi
2014-Jun-17 02:40 UTC
[RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
On Sat, Jun 14, 2014 at 1:29 AM, Ming Lei <ming.lei at canonical.com> wrote:> Firstly this patch supports more than one virtual queues for virtio-blk > device. > > Secondly this patch maps the virtual queue to blk-mq's hardware queue. > > With this approach, both scalability and performance problem can be improved. > > Signed-off-by: Ming Lei <ming.lei at canonical.com> > --- > drivers/block/virtio_blk.c | 75 ++++++++++++++++++++++++++++++++------------ > 1 file changed, 55 insertions(+), 20 deletions(-) > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > index f63d358..e0d077d 100644 > --- a/drivers/block/virtio_blk.c > +++ b/drivers/block/virtio_blk.c > @@ -16,6 +16,8 @@ > > #define PART_BITS 4 > > +#define MAX_NUM_VQ 16It would be nice to allocate virtqueues dynamically instead of hardcoding the limit. virtio-scsi also allocates virtqueues dynamically. Stefan
Ming Lei
2014-Jun-17 15:50 UTC
[RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
On Tue, Jun 17, 2014 at 10:40 AM, Stefan Hajnoczi <stefanha at gmail.com> wrote:> On Sat, Jun 14, 2014 at 1:29 AM, Ming Lei <ming.lei at canonical.com> wrote: >> Firstly this patch supports more than one virtual queues for virtio-blk >> device. >> >> Secondly this patch maps the virtual queue to blk-mq's hardware queue. >> >> With this approach, both scalability and performance problem can be improved. >> >> Signed-off-by: Ming Lei <ming.lei at canonical.com> >> --- >> drivers/block/virtio_blk.c | 75 ++++++++++++++++++++++++++++++++------------ >> 1 file changed, 55 insertions(+), 20 deletions(-) >> >> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c >> index f63d358..e0d077d 100644 >> --- a/drivers/block/virtio_blk.c >> +++ b/drivers/block/virtio_blk.c >> @@ -16,6 +16,8 @@ >> >> #define PART_BITS 4 >> >> +#define MAX_NUM_VQ 16 > > It would be nice to allocate virtqueues dynamically instead of > hardcoding the limit. virtio-scsi also allocates virtqueues > dynamically.virtio-scsi may have lots of LUN, but virtio-blk only has one disk which needn't lots of hardware queues. Also it doesn't matter since it isn't part of ABI. If change on virtio_blk_config is agreed, both host side and guest side can choose to support dynamic length or pre-defined length freely. Thanks, -- Ming Lei
Paolo Bonzini
2014-Jun-17 15:53 UTC
[RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
Il 17/06/2014 17:50, Ming Lei ha scritto:>> > It would be nice to allocate virtqueues dynamically instead of >> > hardcoding the limit. virtio-scsi also allocates virtqueues >> > dynamically. > virtio-scsi may have lots of LUN, but virtio-blk only has one disk > which needn't lots of hardware queues.If you want to do queue steering based on the guest VCPU number, the number of queues must be = to the number of VCPUs shouldn't it? I tried using a divisor of the number of VCPUs, but couldn't get the block layer to deliver interrupts to the right VCPU. Paolo
Apparently Analagous Threads
- [RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
- [RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
- [RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
- [RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
- [RFC PATCH 2/2] block: virtio-blk: support multi virt queues per virtio-blk device