linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Paul Menage" <menage@google.com>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	Linux Containers <containers@lists.osdl.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH 2/2] Make res_counter hierarchical
Date: Tue, 11 Mar 2008 01:57:43 -0700	[thread overview]
Message-ID: <6599ad830803110157u71fe6c3cse125d0202610413b@mail.gmail.com> (raw)
In-Reply-To: <47D63FBC.1010805@openvz.org>

On Tue, Mar 11, 2008 at 1:15 AM, Pavel Emelyanov <xemul@openvz.org> wrote:
>
>  <mem_couter_0>
>   + -- <swap_counter_0>
>   + -- <mem_counter_1>
>   |     + -- <swap_counter_1>
>   |     + -- <mem_counter_11>
>   |     |     + -- <swap_counter_11>
>   |     + -- <mem_counter_12>
>   |           + -- <swap_counter_12>
>   + -- <mem_counter_2>
>   |     + -- <swap_counter_2>
>   |     + -- <mem_counter_21>
>   |     |     + -- <swap_counter_21>
>   |     + -- <mem_counter_22>
>   |           + -- <swap_counter_22>
>   + -- <mem_counter_N>
>        + -- <swap_counter_N>
>        + -- <mem_counter_N1>
>        |     + -- <swap_counter_N1>
>        + -- <mem_counter_N2>
>              + -- <swap_counter_N2>
>

The idea of hierarchy is good, but I don't think this particular
hierarchy works for memory.

Main memory and swap space are very different resources, with very
different performance characteristics. Suppose you have a 2G machine,
and you want to guarantee each job 1GB of main memory, plus give them
the option of 1GB of swap for when they go over the 1G main memory
limit. With the hierarchy given above, you've need to give each job a
2GB mem.limit and a 1GB swap.limit, and so there would be no main
memory isolation.

My feeling is that people are going to want to limit swap and main
memory usage as two independent resource hierarchies more often than
they're going to want to limit overall virtual memory. But assuming
that there are people who need to do the latter, then you should make
it configurable how the hierarchies fit together.

Alternatively, you could make it possible for a res_counter to have
multiple parents (each of which constrains the overall usage of it and
its siblings), and have three counters for each cgroup:

- vm_counter: overall virtual memory limit for group, parent =
parent_mem_cgroup->vm_counter

- mem_counter: main memory limit for group, parents = vm_counter,
parent_mem_cgroup->mem_counter

- swap_counter: swap limit for group, parents = vm_counter,
parent_mem_cgroup->swap_counter

Paul

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-03-11  8:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07 15:32 [PATCH 2/2] Make res_counter hierarchical Pavel Emelyanov
2008-03-08  4:45 ` KAMEZAWA Hiroyuki
2008-03-11  8:15   ` Pavel Emelyanov
2008-03-11  8:32     ` KAMEZAWA Hiroyuki
2008-03-11  8:38       ` Pavel Emelyanov
2008-03-11  9:03         ` Daisuke Nishimura
2008-03-11  9:07         ` KAMEZAWA Hiroyuki
2008-03-11  8:57     ` Paul Menage [this message]
2008-03-11  9:13       ` KAMEZAWA Hiroyuki
2008-03-11  9:11         ` Paul Menage
2008-03-11  9:16           ` Balbir Singh
2008-03-11  9:39             ` KAMEZAWA Hiroyuki
2008-03-11  9:53               ` Balbir Singh
2008-03-11 10:03                 ` KAMEZAWA Hiroyuki
2008-03-11 15:56             ` Paul Menage
2008-03-11 15:59               ` Balbir Singh
2008-03-08 19:06 ` Balbir Singh
2008-03-11  8:17   ` Pavel Emelyanov
2008-03-11  8:24     ` Balbir Singh
2008-03-11  8:40       ` Pavel Emelyanov
2008-03-12 23:05 ` YAMAMOTO Takashi
2008-03-12 23:36   ` YAMAMOTO Takashi
2008-03-13  8:56   ` Pavel Emelyanov
     [not found] ` <47D16004.7050204-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-04-02 15:26   ` Balbir Singh
     [not found]     ` <47F3A5BF.1080301-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-04-03 12:26       ` Pavel Emelyanov

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=6599ad830803110157u71fe6c3cse125d0202610413b@mail.gmail.com \
    --to=menage@google.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=containers@lists.osdl.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=xemul@openvz.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).