All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio: don't always force a notification when ring is full
Date: Wed, 18 Jun 2008 19:40:26 -0500	[thread overview]
Message-ID: <4859AAFA.9000808@us.ibm.com> (raw)
In-Reply-To: <200806190940.57083.rusty@rustcorp.com.au>

Rusty Russell wrote:
> We force notification when the ring is full, even if the host has
> indicated it doesn't want to know.  This seemed like a good idea at
> the time: if we fill the transmit ring, we should tell the host
> immediately.
>
> Unfortunately this logic also applies to the receiving ring, which is
> refilled constantly.  We should introduce real notification thesholds
> to replace this logic.  Meanwhile, removing the logic altogether breaks
> the heuristics which KVM uses, so we use a hack: only notify if there are
> outgoing parts of the new buffer.
>
> It even makes a difference with lguest's crappy network implementation:
> 	1GB guest->host before: 30.0844
> 	1GB guest->host after: 27.6167
>   

A little ugly, but no more performance regression in KVM, so

Acked-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> diff -r 89bf4894cc36 drivers/virtio/virtio_ring.c
> --- a/drivers/virtio/virtio_ring.c	Mon Jun 16 14:31:30 2008 +1000
> +++ b/drivers/virtio/virtio_ring.c	Wed Jun 18 16:15:49 2008 +1000
> @@ -87,8 +87,11 @@ static int vring_add_buf(struct virtqueu
>  	if (vq->num_free < out + in) {
>  		pr_debug("Can't add buf len %i - avail = %i\n",
>  			 out + in, vq->num_free);
> -		/* We notify *even if* VRING_USED_F_NO_NOTIFY is set here. */
> -		vq->notify(&vq->vq);
> +		/* FIXME: for historical reasons, we force a notify here if
> +		 * there are outgoing parts to the buffer.  Presumably the
> +		 * host should service the ring ASAP. */
> +		if (out)
> +			vq->notify(&vq->vq);
>  		END_USE(vq);
>  		return -ENOSPC;
>  	}
>   

  reply	other threads:[~2008-06-19  0:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18 23:40 [PATCH] virtio: don't always force a notification when ring is full Rusty Russell
2008-06-19  0:40 ` Anthony Liguori [this message]
2008-06-19  8:14 ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4859AAFA.9000808@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.