Thread (6 messages) 6 messages, 4 authors, 2017-10-30

Re: [PATCH] virtio_balloon: fix deadlock on OOM

From: Wei Wang <hidden>
Date: 2017-10-19 07:57:55
Also in: lkml

On 10/19/2017 01:19 AM, Michael S. Tsirkin wrote:
On Fri, Oct 13, 2017 at 11:06:23PM +0900, Tetsuo Handa wrote:
quoted
Michael S. Tsirkin wrote:
quoted
This is a replacement for
	[PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()
but unlike that patch it actually deflates on oom even in presence of
lock contention.
But Wei Wang is proposing VIRTIO_BALLOON_F_SG which will try to allocate
memory, isn't he?
Hopefully that can be fixed by allocating outside the lock.
I think that would still have an issue even without the lock, because we 
can't do
any memory allocation in the OOM code path.

Probably, we could write a separate function, leak_balloon_oom() for the 
oom notifier,
which puts the oom deflating pages to the vq one by one, and kick when 
the vq is full.

In this case, we would need to stop the normal leak_balloon while oom 
deflating starts.
However, a better optimization I think would be to do some kind of 
consolidation, since
leak_balloon is already deflating, leak_ballon_oom can just count the 
number of pages
that have been deflated by leak_balloon and return when it reaches 
oom_pages.


Best,
Wei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help