All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Liu <bob.liu@oracle.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: mst@redhat.com, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number changes
Date: Thu, 28 Jul 2016 16:18:08 +0800	[thread overview]
Message-ID: <5799BFC0.1060804@oracle.com> (raw)
In-Reply-To: <3cd56d3a-85f0-9cce-d42f-f4eace84667b@redhat.com>


On 06/19/2016 06:10 AM, Paolo Bonzini wrote:
> 
> 
> On 13/06/2016 11:58, Bob Liu wrote:
>> A guest might be migrated to other hosts with different num_queues, the
>> blk-core should aware of that else the reference of &vblk->vqs[qid] may be wrong.
>>
>> Signed-off-by: Bob Liu <bob.liu@oracle.com>
>> ---
>>  drivers/block/virtio_blk.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>> index 42758b5..c169238 100644
>> --- a/drivers/block/virtio_blk.c
>> +++ b/drivers/block/virtio_blk.c
>> @@ -819,6 +819,9 @@ static int virtblk_restore(struct virtio_device *vdev)
>>  	if (ret)
>>  		return ret;
>>  
>> +	if (vblk->num_vqs != vblk->tag_set.nr_hw_queues)
>> +		blk_mq_update_nr_hw_queues(&vblk->tag_set, vblk->num_vqs);
>> +
>>  	virtio_device_ready(vdev);
>>  
>>  	blk_mq_start_stopped_hw_queues(vblk->disk->queue, true);
>>
> 
> This should never happen; it'd be a configuration problem.
> 

Do you mean all hosts have to be configured with the same number of ->num_vqs?
What about cases like migrating a guest from HostA to HostB while HostB is much more powerful
and would like to run more hardware queues to get better performance.

Thanks,
Bob Liu

WARNING: multiple messages have this Message-ID (diff)
From: Bob Liu <bob.liu@oracle.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mst@redhat.com
Subject: Re: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number changes
Date: Thu, 28 Jul 2016 16:18:08 +0800	[thread overview]
Message-ID: <5799BFC0.1060804@oracle.com> (raw)
In-Reply-To: <3cd56d3a-85f0-9cce-d42f-f4eace84667b@redhat.com>


On 06/19/2016 06:10 AM, Paolo Bonzini wrote:
> 
> 
> On 13/06/2016 11:58, Bob Liu wrote:
>> A guest might be migrated to other hosts with different num_queues, the
>> blk-core should aware of that else the reference of &vblk->vqs[qid] may be wrong.
>>
>> Signed-off-by: Bob Liu <bob.liu@oracle.com>
>> ---
>>  drivers/block/virtio_blk.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>> index 42758b5..c169238 100644
>> --- a/drivers/block/virtio_blk.c
>> +++ b/drivers/block/virtio_blk.c
>> @@ -819,6 +819,9 @@ static int virtblk_restore(struct virtio_device *vdev)
>>  	if (ret)
>>  		return ret;
>>  
>> +	if (vblk->num_vqs != vblk->tag_set.nr_hw_queues)
>> +		blk_mq_update_nr_hw_queues(&vblk->tag_set, vblk->num_vqs);
>> +
>>  	virtio_device_ready(vdev);
>>  
>>  	blk_mq_start_stopped_hw_queues(vblk->disk->queue, true);
>>
> 
> This should never happen; it'd be a configuration problem.
> 

Do you mean all hosts have to be configured with the same number of ->num_vqs?
What about cases like migrating a guest from HostA to HostB while HostB is much more powerful
and would like to run more hardware queues to get better performance.

Thanks,
Bob Liu

 

  reply	other threads:[~2016-07-28  8:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  9:58 [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number changes Bob Liu
2016-06-18 22:10 ` Paolo Bonzini
2016-06-18 22:10   ` Paolo Bonzini
2016-07-28  8:18   ` Bob Liu [this message]
2016-07-28  8:18     ` Bob Liu
2016-08-01  9:58     ` Paolo Bonzini
2016-08-01  9:58       ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2016-06-13  9:58 Bob Liu

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=5799BFC0.1060804@oracle.com \
    --to=bob.liu@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.