qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: edivaldoapereira@yahoo.com.br, qemu-devel@nongnu.org,
	Bug 1066055 <1066055@bugs.launchpad.net>
Subject: Re: [Qemu-devel] [Bug 1066055] Re: Network performance regression with vde_switch
Date: Mon, 22 Oct 2012 16:48:24 +0530	[thread overview]
Message-ID: <20121022111824.GA6916@amit.redhat.com> (raw)
In-Reply-To: <20121016074809.GA23066@stefanha-thinkpad.redhat.com>

On (Tue) 16 Oct 2012 [09:48:09], Stefan Hajnoczi wrote:
> On Mon, Oct 15, 2012 at 09:46:06PM -0000, Edivaldo de Araujo Pereira wrote:
> > Hi Stefan,
> > 
> > Thank you, very much for taking the time to help me, and excuse me for
> > not seeing your answer early...
> > 
> > I've run the procedure you pointed me out, and the result is:
> > 
> > 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f is the first bad commit
> > commit 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f
> > Author: Amit Shah <amit.shah@redhat.com>
> > Date:   Tue Sep 25 00:05:15 2012 +0530
> > 
> >     virtio: Introduce virtqueue_get_avail_bytes()
> > 
> >     The current virtqueue_avail_bytes() is oddly named, and checks if a
> >     particular number of bytes are available in a vq.  A better API is to
> >     fetch the number of bytes available in the vq, and let the caller do
> >     what's interesting with the numbers.
> > 
> >     Introduce virtqueue_get_avail_bytes(), which returns the number of bytes
> >     for buffers marked for both, in as well as out.  virtqueue_avail_bytes()
> >     is made a wrapper over this new function.
> > 
> >     Signed-off-by: Amit Shah <amit.shah@redhat.com>
> >     Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > 
> > :040000 040000 1a58b06a228651cf844621d9ee2f49b525e36c93
> > e09ea66ce7f6874921670b6aeab5bea921a5227d M      hw
> > 
> > I tried to revert that patch in the latest version, but it obviously
> > didnt work; I'm trying to figure out the problem, but I don't know very
> > well the souce code, so I think it's going to take some time. For now,
> > it's all I could do.
> 
> After git-bisect(1) completes it is good to sanity-check the result by
> manually testing 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f^ (the commit
> just before the bad commit) and 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f
> (the bad commit).
> 
> This will verify that the commit indeed introduces the regression.  I
> suggest doing this just to be sure that you've found the bad commit.
> 
> Regarding this commit, I notice two things:
> 
> 1. We will now loop over all vring descriptors because we calculate the
>    total in/out length instead of returning early as soon as we see
>    there is enough space.  Maybe this makes a difference, although I'm a
>    little surprised you see such a huge regression.
> 
> 2. The comparision semantics have changed from:
> 
>      (in_total += vring_desc_len(desc_pa, i)) >= in_bytes
> 
>    to:
> 
>      (in_bytes && in_bytes < in_total)
> 
>    Notice that virtqueue_avail_bytes() now returns 0 when in_bytes ==
>    in_total.  Previously, it would return 1.  Perhaps we are starving or
>    delaying I/O due to this comparison change.  You can easily change
>    '<' to '<=' to see if it fixes the issue.

Hi Edivaldo,

Can you try the following patch, that will confirm if it's the
descriptor walk or the botched compare that's causing the regression.

Thanks,

diff --git a/hw/virtio.c b/hw/virtio.c
index 6821092..bb08ed8 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -406,8 +406,8 @@ int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
     unsigned int in_total, out_total;
 
     virtqueue_get_avail_bytes(vq, &in_total, &out_total);
-    if ((in_bytes && in_bytes < in_total)
-        || (out_bytes && out_bytes < out_total)) {
+    if ((in_bytes && in_bytes <= in_total)
+        || (out_bytes && out_bytes <= out_total)) {
         return 1;
     }
     return 0;


		Amit

  reply	other threads:[~2012-10-22 11:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 17:34 [Qemu-devel] [Bug 1066055] [NEW] Network performance regression with vde_switch Edivaldo de Araujo Pereira
2012-10-15  8:58 ` Stefan Hajnoczi
2012-10-15 21:46 ` [Qemu-devel] [Bug 1066055] " Edivaldo de Araujo Pereira
2012-10-16  7:48   ` Stefan Hajnoczi
2012-10-22 11:18     ` Amit Shah [this message]
2012-10-22 13:50       ` Edivaldo de Araujo Pereira
2012-10-23 12:55         ` Stefan Hajnoczi
2012-11-01  9:19           ` Amit Shah
2012-11-01 12:04             ` Michael S. Tsirkin
2012-11-01 15:12               ` Amit Shah
2012-11-01 15:50                 ` Michael S. Tsirkin
2012-11-01 16:07               ` [Qemu-devel] [PATCH] virtio: limit avail bytes lookahead Michael S. Tsirkin
2012-11-02  9:56                 ` Amit Shah
2012-11-02 10:18                 ` Stefan Hajnoczi
2012-11-02 14:48                   ` Michael S. Tsirkin
2012-11-02 19:44                     ` Stefan Hajnoczi
2012-11-27 16:25                 ` Michael S. Tsirkin
2012-11-27 16:54                   ` Edivaldo de Araujo Pereira
2012-11-27 19:47                   ` Anthony Liguori
2012-11-28 21:53                   ` Michael S. Tsirkin
2012-11-29 13:04                     ` Amit Shah
2012-11-29 14:10                       ` Michael S. Tsirkin
2012-11-29 19:02                         ` Anthony Liguori
2012-11-29 22:39                           ` Michael S. Tsirkin
2012-11-01 11:42   ` [Qemu-devel] [Bug 1066055] Re: Network performance regression with vde_switch Michael S. Tsirkin
2012-10-16 12:23 ` Edivaldo de Araujo Pereira
2012-10-17 13:51   ` Stefan Hajnoczi
2018-01-10 21:28 ` Thomas Huth

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=20121022111824.GA6916@amit.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=1066055@bugs.launchpad.net \
    --cc=edivaldoapereira@yahoo.com.br \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).