From: "Michael S. Tsirkin" <mst@redhat.com>
To: Roman Kagan <rkagan@virtuozzo.com>,
qemu-devel@nongnu.org, Ladi Prosek <lprosek@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-balloon: resume collecting stats on vmload
Date: Tue, 6 Sep 2016 13:15:55 +0300 [thread overview]
Message-ID: <20160906131347-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20160906064959.x53yeudhvcd4xrix@rkaganb.sw.ru>
On Tue, Sep 06, 2016 at 09:50:00AM +0300, Roman Kagan wrote:
> On Tue, Sep 06, 2016 at 04:45:13AM +0300, Michael S. Tsirkin wrote:
> > On Mon, Sep 05, 2016 at 11:02:36AM +0300, Roman Kagan wrote:
> > > On Sat, Sep 03, 2016 at 01:53:53AM +0300, Michael S. Tsirkin wrote:
> > > > On Fri, Sep 02, 2016 at 10:21:58AM +0300, Roman Kagan wrote:
> > > > > On Thu, Sep 01, 2016 at 10:26:54PM +0300, Michael S. Tsirkin wrote:
> > > > > > I'm sorry - I don't like this patch. This means that
> > > > > > virtio_balloon_receive_stats will be called and will poke
> > > > > > at the ring even if the ring was never kicked.
> > > > >
> > > > > I'm not sure I understand what the problem is with that:
> > > > > virtio_balloon_receive_stats just returns early if virtio_queue_empty(),
> > > > > which is no more poking at the ring than is already done in virtio_load.
> > > >
> > > > Generally we should not look at ring until there was a kick.
> > >
> > > How else would you recover ->inuse?
> > >
> > > Roman.
> >
> > We seem to do this:
> > + vdev->vq[i].inuse = vdev->vq[i].last_avail_idx -
> > + vdev->vq[i].used_idx;
>
> Right, but .used_idx is fetched from vring two lines above:
>
> vdev->vq[i].used_idx = vring_used_idx(&vdev->vq[i]);
>
> > Is this wrong?
>
> And no, I don't think it is wrong :) I guess there's just no other way
> to obtain it.
>
> Roman.
Hmm right. It actually has a comment:
/* XXX virtio-1 devices */
So we do need to fix it.
Let's not add more stuff like this though.
--
MST
prev parent reply other threads:[~2016-09-06 10:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 18:13 [Qemu-devel] [PATCH 0/2] virtio-balloon: resume collecting stats on vmload Roman Kagan
2016-09-01 18:13 ` [Qemu-devel] [PATCH 1/2] virtio: add virtqueue_rewind Roman Kagan
2016-09-01 18:14 ` [Qemu-devel] [PATCH 2/2] virtio-balloon: resume collecting stats on vmload Roman Kagan
2016-09-01 19:26 ` Michael S. Tsirkin
2016-09-02 7:21 ` Roman Kagan
2016-09-02 22:53 ` Michael S. Tsirkin
2016-09-05 8:02 ` Roman Kagan
2016-09-06 1:45 ` Michael S. Tsirkin
2016-09-06 6:50 ` Roman Kagan
2016-09-06 10:15 ` Michael S. Tsirkin [this message]
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=20160906131347-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=lprosek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkagan@virtuozzo.com \
--cc=stefanha@redhat.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).