From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157AbcAEOhi (ORCPT ); Tue, 5 Jan 2016 09:37:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:37536 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbcAEOhf (ORCPT ); Tue, 5 Jan 2016 09:37:35 -0500 Date: Tue, 5 Jan 2016 15:37:33 +0100 From: Petr Mladek To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Jeff Epler , Tejun Heo , Jiri Kosina Subject: Re: [PATCH RFC] virtio_balloon: refill by config handler Message-ID: <20160105143733.GE3178@pathway.suse.cz> References: <1451643122-21561-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1451643122-21561-1-git-send-email-mst@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2016-01-01 12:13:48, Michael S. Tsirkin wrote: > Peter Mladek reported that balloon might never refill completely after > restore. This is because fill_balloon is only called once there. > Calling fill_balloon repeatedly seems too aggressive, > especially in light of the fact that it sleeps on failure: let's > wake the config change handler and fill it asynchronously. > > Reported-by: Petr Mladek > Signed-off-by: Michael S. Tsirkin > --- > > I was unable to test this - for some reason my test VM > doesn't resume (with or without the patch). > Petr, does this work for you? Ah, I have just realized that the problem happens only after the conversion to the workqueue. It works without this patch with the current code. The balloon kthread is waken when released from __refrigerator(). I am sorry for the noise. I wanted to split the conversion to workqueues into two patches to make it better readable. We need to queue the balloon resizing work here. I wrongly assumed that the original kthread must have the same problem. Best Regards, Petr > drivers/virtio/virtio_balloon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index 7efc329..ee29473 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -589,7 +589,7 @@ static int virtballoon_restore(struct virtio_device *vdev) > > virtio_device_ready(vdev); > > - fill_balloon(vb, towards_target(vb)); > + wake_up(&vb->config_change); > update_balloon_size(vb); > return 0; > } > -- > MST