aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-06-13 10:56:31 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:57 -0400
commitb5ee8f2802c559fccb177c0a117f5cd56c1049cc (patch)
tree6070c23dd5e23bc02bae19b3d74c8ad88d739cdb
parenta752359f2b0a291c5f229e883842e4b30c698387 (diff)
[SCSI] virtio-scsi: unlock during kick
Separate virtqueue_kick_prepare from virtqueue_notify, so that the expensive vmexit is done without holding the lock. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/virtio_scsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 1b3843117268..b0ad5aa6b552 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -264,9 +264,11 @@ static int virtscsi_kick_cmd(struct virtio_scsi *vscsi, struct virtqueue *vq,
264 264
265 ret = virtqueue_add_buf(vq, vscsi->sg, out_num, in_num, cmd, gfp); 265 ret = virtqueue_add_buf(vq, vscsi->sg, out_num, in_num, cmd, gfp);
266 if (ret >= 0) 266 if (ret >= 0)
267 virtqueue_kick(vq); 267 ret = virtqueue_kick_prepare(vq);
268 268
269 spin_unlock_irqrestore(&vscsi->vq_lock, flags); 269 spin_unlock_irqrestore(&vscsi->vq_lock, flags);
270 if (ret > 0)
271 virtqueue_notify(vq);
270 return ret; 272 return ret;
271} 273}
272 274