[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59E85B7A.1090800@intel.com>
Date: Thu, 19 Oct 2017 15:59:54 +0800
From: Wei Wang <wei.w.wang@...el.com>
To: "Michael S. Tsirkin" <mst@...hat.com>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
CC: linux-kernel@...r.kernel.org, mhocko@...e.com, jasowang@...hat.com,
virtualization@...ts.linux-foundation.org, linux-mm@...ck.org
Subject: Re: [PATCH] virtio_balloon: fix deadlock on OOM
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
Powered by blists - more mailing lists