linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Evgeniy Ivanov <lolkaantimat@gmail.com>,
	linux-mm <linux-mm@kvack.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: cgroups and overcommit question
Date: Thu, 13 Jan 2011 08:34:15 +0530	[thread overview]
Message-ID: <20110113030415.GF2897@balbir.in.ibm.com> (raw)
In-Reply-To: <20110113105741.dd38d58e.nishimura@mxp.nes.nec.co.jp>

* nishimura@mxp.nes.nec.co.jp <nishimura@mxp.nes.nec.co.jp> [2011-01-13 10:57:41]:

> Hi.
> 
> On Wed, 12 Jan 2011 18:40:37 +0300
> Evgeniy Ivanov <lolkaantimat@gmail.com> wrote:
> 
> > Hello,
> > 
> > When I forbid memory overcommiting, malloc() returns 0 if can't
> > reserve memory, but in a cgroup it will always succeed, when it can
> > succeed when not in the group.
> > E.g. I've set 2 to overcommit_memory, limit is 10M: I can ask malloc
> > 100M and it will not return any error (kernel is 2.6.32).
> > Is it expected behavior?
> > 
> Yes. Because memory cgroup can be used for limiting the memory(and swap) size
> which is physically used, not the malloc'ed size.
>

I had rlimit based cgroup to limit virtual memory size, but the
patches were never merged due to lack of use cases :( 

See http://lwn.net/Articles/283287/

I did advocate as use case the ability to prevent overcommit. I
suspect another way of solving this problem is to have overcommit
control. The problem today is that OOM is our backup to overcommit,
not a very comfortable feeling.

-- 
	Three Cheers,
	Balbir

--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-01-13  3:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 15:40 cgroups and overcommit question Evgeniy Ivanov
2011-01-13  1:57 ` Daisuke Nishimura
2011-01-13  3:04   ` Balbir Singh [this message]
2011-01-13 12:24     ` Evgeniy Ivanov

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=20110113030415.GF2897@balbir.in.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=lolkaantimat@gmail.com \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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).