---
 drivers/virtio/virtio_ring.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff -r 3f6e409bd1eb drivers/virtio/virtio_ring.c
--- a/drivers/virtio/virtio_ring.c	Mon Jun 02 13:43:09 2008 +1000
+++ b/drivers/virtio/virtio_ring.c	Mon Jun 02 13:56:57 2008 +1000
@@ -52,6 +52,9 @@ struct vring_virtqueue
 	unsigned int free_head;
 	/* Number we've added since last sync. */
 	unsigned int num_added;
+
+	/* Threshold for notification. */
+	unsigned int thresh_remaining;
 
 	/* How to notify other side. FIXME: commonalize hcalls! */
 	void (*notify)(struct virtqueue *vq);
@@ -142,7 +145,8 @@ static void vring_kick(struct virtqueue 
 	/* Need to update avail index before checking if we should notify */
 	mb();
 
-	if (!(vq->vring.used->flags & VRING_USED_F_NO_NOTIFY))
+	if (!(vq->vring.used->flags & VRING_USED_F_NO_NOTIFY)
+	    || vq->num_free < vq->thresh_remaining)
 		/* Prod other side to tell it about changes. */
 		vq->notify(&vq->vq);
 
@@ -297,6 +301,7 @@ struct virtqueue *vring_new_virtqueue(un
 	vq->notify = notify;
 	vq->broken = false;
 	vq->num_added = 0;
+	vq->thresh_remaining = num / 2;
 #ifdef DEBUG
 	vq->in_use = false;
 #endif
