Re: [PATCH] virtio_balloon: fix deadlock on OOM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/19/2017 01:19 AM, Michael S. Tsirkin wrote:
On Fri, Oct 13, 2017 at 11:06:23PM +0900, Tetsuo Handa wrote:
Michael S. Tsirkin wrote:
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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux