Skip to content

Commit

Permalink
[SCSI] virtio-scsi: unlock during kick
Browse files Browse the repository at this point in the history
Separate virtqueue_kick_prepare from virtqueue_notify, so that the
expensive vmexit is done without holding the lock.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
bonzini authored and James Bottomley committed Jul 20, 2012
1 parent a752359 commit b5ee8f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/virtio_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,11 @@ static int virtscsi_kick_cmd(struct virtio_scsi *vscsi, struct virtqueue *vq,

ret = virtqueue_add_buf(vq, vscsi->sg, out_num, in_num, cmd, gfp);
if (ret >= 0)
virtqueue_kick(vq);
ret = virtqueue_kick_prepare(vq);

spin_unlock_irqrestore(&vscsi->vq_lock, flags);
if (ret > 0)
virtqueue_notify(vq);
return ret;
}

Expand Down

0 comments on commit b5ee8f2

Please sign in to comment.