From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
avi@redhat.com, Rusty Russell <rusty@rustcorp.com.au>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [PATCH] kvm: add oom notifier for virtio balloon
Date: Fri, 8 Oct 2010 21:23:43 +0530 [thread overview]
Message-ID: <20101008155343.GD5327@balbir.in.ibm.com> (raw)
In-Reply-To: <AANLkTimd2Z3Yy9yxHZA6raeFxp6L7Wtvy5rLSrMyjEU1@mail.gmail.com>
* Dave Young <hidave.darkstar@gmail.com> [2010-10-08 21:33:02]:
> On Fri, Oct 8, 2010 at 9:09 PM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > * Dave Young <hidave.darkstar@gmail.com> [2010-10-05 20:45:21]:
> >
> >> Balloon could cause guest memory oom killing and panic.
> >>
> >> Add oom notify to leak some memory and retry fill balloon after 5 minutes.
> >>
> >> At the same time add a mutex to protect balloon operations
> >> because we need leak balloon in oom notifier and give back freed value.
> >>
> >> Thanks Anthony Liguori for his sugestion about inflate retrying.
> >> Sometimes it will cause endless inflate/oom/delay loop,
> >> so I think next step is to add an option to do noretry-when-oom balloon.
> >>
> >> Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
> >
> > Won't __GFP_NORETRY prevent OOM? Could you please describe how you
> > tested the patch?
>
> I have not tried __GFP_NORETRY, it should work, but balloon thread
> will keep wasting cpu resource to allocating.
>
>
> To test the patch, just balloon to small than minimal memory.
>
> I use "balloon 30" in qemu monitor to limit slackware guest memory
> usage. The normal memory used is ~40M.
>
> Actually we need to differentiate the process which caused oom. If it
> is balloon thread we should just stop ballooning, if it is others we
> can do something like this patch, e.g. retry ballooning after 5
> minutes.
Ideally the balloon thread should never OOM with __GFP_NORETRY (IIRC).
The other situation should be dealt with, we should free up any pages
we have. I wonder if the timeout should be a sysctl tunable.
--
Three Cheers,
Balbir
next prev parent reply other threads:[~2010-10-08 15:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 12:45 [PATCH] kvm: add oom notifier for virtio balloon Dave Young
2010-10-06 9:05 ` Rusty Russell
2010-10-06 13:50 ` Dave Young
2010-10-08 10:24 ` Dave Young
2010-10-08 13:09 ` Balbir Singh
2010-10-08 13:33 ` Dave Young
2010-10-08 15:53 ` Balbir Singh [this message]
2010-10-09 3:19 ` Dave Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101008155343.GD5327@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=hidave.darkstar@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox