* Asias He <[email protected]> wrote:

> Signed-off-by: Asias He <[email protected]>
> ---
>  tools/kvm/virtio-blk.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/kvm/virtio-blk.c b/tools/kvm/virtio-blk.c
> index 3feabd0..ade6335 100644
> --- a/tools/kvm/virtio-blk.c
> +++ b/tools/kvm/virtio-blk.c
> @@ -159,7 +159,9 @@ static void virtio_blk_do_io(struct kvm *kvm, void *param)
>       while (virt_queue__available(vq))
>               virtio_blk_do_io_request(kvm, vq);
>  
> +     mutex_lock(&blk_device.mutex);
>       kvm__irq_line(kvm, VIRTIO_BLK_IRQ, 1);
> +     mutex_unlock(&blk_device.mutex);

Hm, this looks a bit strange (the mutex here protects only a kernel call - that 
cannot be right) and there's no explanation why it's needed. Why do 
VIRTIO_BLK_IRQ (== KVM_IRQ_LINE ioctl()) calls have to be covered by the mutex?

A short blurb about expected behavior on SMP and locking rules at the top of 
virtio-blk.c would be nice.

Thanks,

        Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to