Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-19 Thread Michael S. Tsirkin
On Thu, Oct 19, 2017 at 08:52:20PM +0900, Tetsuo Handa wrote: > Michael S. Tsirkin wrote: > > On Wed, Oct 18, 2017 at 07:59:23PM +0900, Tetsuo Handa wrote: > > > Do you see anything wrong with the patch I used for emulating > > > VIRTIO_BALLOON_F_DEFLATE_ON_OOM path (shown below) ? > > > > > >

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-19 Thread Tetsuo Handa
Michael S. Tsirkin wrote: > On Wed, Oct 18, 2017 at 07:59:23PM +0900, Tetsuo Handa wrote: > > Do you see anything wrong with the patch I used for emulating > > VIRTIO_BALLOON_F_DEFLATE_ON_OOM path (shown below) ? > > > > > > diff --git

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-18 Thread Michael S. Tsirkin
On Wed, Oct 18, 2017 at 07:59:23PM +0900, Tetsuo Handa wrote: > Tetsuo Handa wrote: > > 20171016-deflate.log.xz continued printing "puff" messages without any OOM > > killer messages, for fill_balloon() always inflates faster than > > leak_balloon() > > deflates. > > > > Since the OOM killer

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-18 Thread Tetsuo Handa
Tetsuo Handa wrote: > 20171016-deflate.log.xz continued printing "puff" messages without any OOM > killer messages, for fill_balloon() always inflates faster than leak_balloon() > deflates. > > Since the OOM killer cannot be invoked unless leak_balloon() completely > deflates faster than

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-16 Thread Michael S. Tsirkin
On Mon, Oct 16, 2017 at 07:58:29PM +0900, Tetsuo Handa wrote: > Tetsuo Handa wrote: > > Michael S. Tsirkin wrote: > > > > > > > > > > The proper fix isn't that hard - just avoid allocations under lock. > > > > > > > > > > Patch posted, pls take a look. > > > > > > > > Your patch allocates pages

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-16 Thread Tetsuo Handa
Tetsuo Handa wrote: > Michael S. Tsirkin wrote: > > > > > > > > The proper fix isn't that hard - just avoid allocations under lock. > > > > > > > > Patch posted, pls take a look. > > > > > > Your patch allocates pages in order to inflate the balloon, but > > > your patch will allow

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-14 Thread Tetsuo Handa
Michael S. Tsirkin wrote: > > > > > > The proper fix isn't that hard - just avoid allocations under lock. > > > > > > Patch posted, pls take a look. > > > > Your patch allocates pages in order to inflate the balloon, but > > your patch will allow leak_balloon() to deflate the balloon. > > How

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-14 Thread Michael S. Tsirkin
On Sat, Oct 14, 2017 at 01:41:14AM +0900, Tetsuo Handa wrote: > Michael S. Tsirkin wrote: > > On Tue, Oct 10, 2017 at 07:47:37PM +0900, Tetsuo Handa wrote: > > > In leak_balloon(), mutex_lock(>balloon_lock) is called in order to > > > serialize against fill_balloon(). But in fill_balloon(), > > >

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-13 Thread Tetsuo Handa
Michael S. Tsirkin wrote: > On Tue, Oct 10, 2017 at 07:47:37PM +0900, Tetsuo Handa wrote: > > In leak_balloon(), mutex_lock(>balloon_lock) is called in order to > > serialize against fill_balloon(). But in fill_balloon(), > > alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-13 Thread Michael S. Tsirkin
On Tue, Oct 10, 2017 at 07:47:37PM +0900, Tetsuo Handa wrote: > In leak_balloon(), mutex_lock(>balloon_lock) is called in order to > serialize against fill_balloon(). But in fill_balloon(), > alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is > called with vb->balloon_lock

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-13 Thread Michael S. Tsirkin
19:28:20 +0900 > Subject: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify() > > In leak_balloon(), mutex_lock(>balloon_lock) is called in order to > serialize against fill_balloon(). But in fill_balloon(), > alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEM

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-11 Thread Wei Wang
On 10/10/2017 06:47 PM, Tetsuo Handa wrote: In leak_balloon(), mutex_lock(>balloon_lock) is called in order to serialize against fill_balloon(). But in fill_balloon(), alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is called with vb->balloon_lock mutex held. Since

Re: [PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()

2017-10-10 Thread Michal Hocko
On Tue 10-10-17 19:47:37, Tetsuo Handa wrote: > In leak_balloon(), mutex_lock(>balloon_lock) is called in order to > serialize against fill_balloon(). But in fill_balloon(), > alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is > called with vb->balloon_lock mutex held. Since