From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh5Rw-0006Az-7F for qemu-devel@nongnu.org; Mon, 05 Sep 2016 21:45:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh5Rs-0004Iv-1e for qemu-devel@nongnu.org; Mon, 05 Sep 2016 21:45:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh5Rr-0004Ir-SF for qemu-devel@nongnu.org; Mon, 05 Sep 2016 21:45:15 -0400 Date: Tue, 6 Sep 2016 04:45:13 +0300 From: "Michael S. Tsirkin" Message-ID: <20160906044457-mutt-send-email-mst@kernel.org> References: <1472753640-18375-1-git-send-email-rkagan@virtuozzo.com> <1472753640-18375-3-git-send-email-rkagan@virtuozzo.com> <20160901192654.sp5cqq7v2wddq5ej@redhat.com> <20160902072141.fe2xamm3spzsqwnw@rkaganb.sw.ru> <20160903015313-mutt-send-email-mst@kernel.org> <20160905080236.bbk2ugjajalyqptv@rkaganb.sw.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160905080236.bbk2ugjajalyqptv@rkaganb.sw.ru> Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-balloon: resume collecting stats on vmload List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Kagan , qemu-devel@nongnu.org, Ladi Prosek , Stefan Hajnoczi 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; Is this wrong? -- MST