From: "Denis V. Lunev" <den@openvz.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: den@openvz.org, virtualization@lists.linux-foundation.org,
Raushaniya Maksudova <rmaksudova@parallels.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM
Date: Mon, 13 Oct 2014 11:01:41 +0400 [thread overview]
Message-ID: <543B78D5.1050903@openvz.org> (raw)
In-Reply-To: <87iojoedq3.fsf@rustcorp.com.au>
On 13/10/14 09:32, Rusty Russell wrote:
> "Denis V. Lunev" <den@parallels.com> writes:
>> From: Raushaniya Maksudova <rmaksudova@parallels.com>
>>
>> Excessive virtio_balloon inflation can cause invocation of OOM-killer,
>> when Linux is under severe memory pressure. Various mechanisms are
>> responsible for correct virtio_balloon memory management. Nevertheless
>> it is often the case that these control tools does not have enough time
>> to react on fast changing memory load. As a result OS runs out of memory
>> and invokes OOM-killer. The balancing of memory by use of the virtio
>> balloon should not cause the termination of processes while there are
>> pages in the balloon. Now there is no way for virtio balloon driver to
>> free some memory at the last moment before some process will be get
>> killed by OOM-killer.
> This makes some amount of sense.
>
> But I suggest a few minor changes:
>
>> +static int oom_vballoon_pages = OOM_VBALLOON_DEFAULT_PAGES;
>> +module_param(oom_vballoon_pages, int, S_IRUSR | S_IWUSR);
>> +MODULE_PARM_DESC(oom_vballoon_pages, "pages to free on OOM");
> Since this is already prefixed with "virtio_balloon." I suggest just
> calling it "oom_pages".
ok, will do
>> +static int virtballoon_oom_notify(struct notifier_block *self,
>> + unsigned long dummy, void *parm)
>> +{
>> + unsigned int num_freed_pages;
>> + unsigned long *freed = (unsigned long *)parm;
>> + struct virtio_balloon *vb = container_of((struct notifier_block *)self,
>> + struct virtio_balloon, nb);
> Why cast self here?
this is a piece from a previous version of the patch, I'll fix this and
resend.
>> + num_freed_pages = leak_balloon(vb, oom_vballoon_pages);
>> + update_balloon_size(vb);
>> + *freed += num_freed_pages;
>> +
>> + return NOTIFY_OK;
>> +}
> Cheers,
> Rusty.
next prev parent reply other threads:[~2014-10-13 7:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 10:21 [PATCH 0/2] shrink virtio baloon on OOM in guest Denis V. Lunev
2014-10-08 10:21 ` [PATCH 1/2] virtio_balloon: return the amount of freed memory from leak_balloon() Denis V. Lunev
2014-10-08 10:21 ` [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM Denis V. Lunev
2014-10-13 5:32 ` Rusty Russell
2014-10-13 7:01 ` Denis V. Lunev [this message]
2014-10-13 7:22 ` Michael S. Tsirkin
2014-10-13 23:44 ` Rusty Russell
2014-10-14 9:10 ` Michael S. Tsirkin
2014-10-15 5:37 ` Rusty Russell
2014-10-15 6:32 ` Denis V. Lunev
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=543B78D5.1050903@openvz.org \
--to=den@openvz.org \
--cc=mst@redhat.com \
--cc=rmaksudova@parallels.com \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).