Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1451786 > unrolled thread

Re: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number changes

Started byBob Liu <bob.liu@oracle.com>
First post2016-07-28 10:20 +0200
Last post2016-08-01 12:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number  changes Bob Liu <bob.liu@oracle.com> - 2016-07-28 10:20 +0200
    Re: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number  changes Paolo Bonzini <pbonzini@redhat.com> - 2016-08-01 12:20 +0200

#1451786 — Re: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number changes

FromBob Liu <bob.liu@oracle.com>
Date2016-07-28 10:20 +0200
SubjectRe: [PATCH] drivers: virtio_blk: notify blk-core when hw-queue number changes
Message-ID<rZOHT-3yL-5@gated-at.bofh.it>
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

 

[toc] | [next] | [standalone]


#1453115

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-08-01 12:20 +0200
Message-ID<s1iue-500-35@gated-at.bofh.it>
In reply to#1451786

On 28/07/2016 10:18, 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.

The number of queues should be equal to the number of CPUs for the
guest, not to the number of CPUs or queues on the host.  The idea is to
have one queue per guest vCPU.

Paolo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web