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 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 2/3] virtio-balloon: deflate up to oom_pages on OOM

2017-10-21 Thread Tetsuo Handa
Michael S. Tsirkin wrote: > On Fri, Oct 20, 2017 at 07:54:25PM +0800, Wei Wang wrote: > > The current implementation only deflates 256 pages even when a user > > specifies more than that via the oom_pages module param. This patch > > enables the deflating of up to oom_pages pages if there are

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

2017-10-21 Thread Tetsuo Handa
Michael S. Tsirkin wrote: > On Fri, Oct 20, 2017 at 07:54:25PM +0800, Wei Wang wrote: > > The current implementation only deflates 256 pages even when a user > > specifies more than that via the oom_pages module param. This patch > > enables the deflating of up to oom_pages pages if there are

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

2017-10-21 Thread Michael S. Tsirkin
On Fri, Oct 20, 2017 at 07:54:25PM +0800, Wei Wang wrote: > The current implementation only deflates 256 pages even when a user > specifies more than that via the oom_pages module param. This patch > enables the deflating of up to oom_pages pages if there are enough > inflated pages. > >

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

2017-10-21 Thread Michael S. Tsirkin
On Fri, Oct 20, 2017 at 07:54:25PM +0800, Wei Wang wrote: > The current implementation only deflates 256 pages even when a user > specifies more than that via the oom_pages module param. This patch > enables the deflating of up to oom_pages pages if there are enough > inflated pages. > >

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

2017-10-20 Thread Wei Wang
The current implementation only deflates 256 pages even when a user specifies more than that via the oom_pages module param. This patch enables the deflating of up to oom_pages pages if there are enough inflated pages. Signed-off-by: Wei Wang Cc: Michael S. Tsirkin

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

2017-10-20 Thread Wei Wang
The current implementation only deflates 256 pages even when a user specifies more than that via the oom_pages module param. This patch enables the deflating of up to oom_pages pages if there are enough inflated pages. Signed-off-by: Wei Wang Cc: Michael S. Tsirkin Cc: Michal Hocko Cc: Tetsuo