Re: [PATCH v1 3/3] virtio-balloon: stop inflating when OOM occurs

2017-10-22 Thread Michael S. Tsirkin
On Fri, Oct 20, 2017 at 07:54:26PM +0800, Wei Wang wrote: > This patch forces the cease of the inflating work when OOM occurs. > The fundamental idea of memory ballooning is to take out some guest > pages when the guest has low memory utilization, so it is sensible to > inflate nothing when the

Re: [PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock

2017-10-22 Thread Tetsuo Handa
Wei Wang wrote: > >> @@ -162,20 +160,20 @@ static unsigned fill_balloon(struct virtio_balloon > >> *vb, size_t num) > >>msleep(200); > >>break; > >>} > >> - set_page_pfns(vb, vb->pfns + vb->num_pfns, page); > >> - vb->num_pages

Re: [PATCH v1 2/3] virtio-balloon: deflate up to oom_pages on OOM

2017-10-22 Thread Wei Wang
On 10/22/2017 12:11 PM, Tetsuo Handa wrote: Michael S. Tsirkin wrote: - num_freed_pages = leak_balloon(vb, oom_pages); + + /* Don't deflate more than the number of inflated pages */ + while (npages && atomic64_read(>num_pages)) + npages -= leak_balloon(vb,

Re: [PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock

2017-10-22 Thread Wei Wang
On 10/22/2017 01:20 PM, Tetsuo Handa wrote: Wei Wang wrote: The balloon_lock was used to synchronize the access demand to elements of struct virtio_balloon and its queue operations (please see commit e22504296d). This prevents the concurrent run of the leak_balloon and fill_balloon functions,

Re: [PATCH v1 0/3] Virtio-balloon Improvement

2017-10-22 Thread Wei Wang
On 10/22/2017 11:19 AM, Michael S. Tsirkin wrote: On Fri, Oct 20, 2017 at 07:54:23PM +0800, Wei Wang wrote: This patch series intends to summarize the recent contributions made by Michael S. Tsirkin, Tetsuo Handa, Michal Hocko etc. via reporting and discussing the related deadlock issues on the