From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: kamezawa.hiroyu@jp.fujitsu.com
Cc: linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
xemul@openvz.org, menage@google.com, yamamoto@valinux.co.jp,
lizf@cn.fujitsu.com
Subject: Re: [RFC][PATCH 1/2] memcg: res_counter hierarchy
Date: Sat, 31 May 2008 22:48:34 +0530 [thread overview]
Message-ID: <4841886A.1000901@linux.vnet.ibm.com> (raw)
In-Reply-To: <26479923.1212245220415.kamezawa.hiroyu@jp.fujitsu.com>
kamezawa.hiroyu@jp.fujitsu.com wrote:
> ----- Original Message -----
>
>>> One more problem is that it's hard to implement various kinds of hierarchy
>>> policy. I believe there are other hierarhcy policies rather than OpenVZ
>>> want to use. Kicking out functions to middleware AMAP is what I'm thinking
>>> now.
>> One way to manage hierarchies other than via limits is to use shares (please
> see
>> the shares used by the cpu controller). Basically, what you've done with limi
> ts
>> is done with shares
>>
> Yes, I like _share_ rather than limits.
>
>> If a parent has 100 shares, then it can decide how many to pass on to it's c
> hildren
>> based on the shares of the child and your logic would work well. I propose
>> assigning top level (high resolution) shares to the root of the cgroup and in
> a
>> hierarchy passing them down to children and sharing it with them. Based on th
> e
>> shares, deduce the limit of each node in the hierarchy.
>>
>> What do you think?
>>
> As you wrote, a middleware can do controls based on share by limits.
> And it seems much easier to implement it in userland rather than in the kernel
> .
The good thing about user space is that moves unnecessary code outside the
kernel, but the hard thing is standardization. If every middleware is going to
implement what you say, imagine the code duplication, unless we standardize this
into a library component. More comments below. I am not sure about the
difference between user_memory_limit and kernel_memory_limit. Could you please
elaborate.
>
> Here is an example. (just an example...)
> Please point out if I'm misunderstanding "share".
>
> root_level/ = limit 1G.
> /child_A = share=30
> /child_B = share=15
> /child_C = share=5
> (and assume there is no process under root_level for make explanation easy..)
>
> 0. At first, before starting to use memory, set all kernel_memory_limit.
> root_level.limit = 1G
> child_A.limit=64M,usage=0
> child_B.limit=64M,usage=0
> child_C.limit=64M,usage=0
> free_resource=808M
>
This sounds incorrect, since the limits should be proportional to shares. If the
maximum shares in the root were 100 (*ideally we want higher resolution than that)
Then
child_A.limit = .3 * 1G
child_B.limit = .15 * 1G
and so on
> 1. next, a process in child_C start to run and use memory of 600M.
> root_level.limit = 1G
> child_A.limit=64M
> child_B.limit=64M
> child_C.limit=600M,usage=600M
> free_resource=272M
>
How is that feasible, it's limit was 64M, how did it bump up to 600M? If you
want something like that, child_C should have no limits.
> 2. now, a process in child_A start tu run and use memory of 800M.
> child_A.limit=800M,usage=800M
> child_B.limit=64M,usage=0M
> child_C.limit=136M,usage=136M
> free_resouce=0,A:C=6:1
>
Not sure I understand this step
> 3.Finally, a process in child_B start. and use memory of 500M.
> child_A.limit=600M,usage=600M
> child_B.limit=300M,usage=300M
> child_C.limit=100M,usage=100M
> free_resouce=0, A:B:C=6:3:1
>
Not sure I understand this step
> 4. one more, a process in A exits.
> child_A.limit=64M, usage=0M
> child_B.limit=500M, usage=500M
> child_C.limit=436M, usage=436M
> free_resouce=0, B:C=3:1 (but B just want to use 500M)
>
Not sure I understand this step
> This is only an example and the middleware can more pricise "limit"
> contols by checking statistics of memory controller hierarchy based on
> their own policy.
>
> What I think now is what kind of statistics/notifier/controls are
> necessary to implement shares in middleware. How pricise/quick work the
> middleware can do is based on interfaces.
> Maybe the middleware should know "how fast the application runs now" by
> some kind of check or co-operative interface with the application.
> But I'm not sure how the kernel can help it.
I am not sure if I understand your proposal at this point.
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
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>
next prev parent reply other threads:[~2008-05-31 17:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-30 1:43 [RFC][PATCH 0/2] memcg: simple hierarchy (v2) KAMEZAWA Hiroyuki
2008-05-30 1:45 ` [RFC][PATCH 1/2] memcg: res_counter hierarchy KAMEZAWA Hiroyuki
2008-05-30 22:20 ` Balbir Singh
2008-05-31 1:59 ` kamezawa.hiroyu
2008-05-31 11:20 ` Balbir Singh
2008-05-31 14:47 ` kamezawa.hiroyu
2008-05-31 17:18 ` Balbir Singh [this message]
2008-06-01 0:35 ` kamezawa.hiroyu
2008-06-02 6:16 ` Balbir Singh
2008-06-02 9:48 ` kamezawa.hiroyu
2008-06-02 2:15 ` YAMAMOTO Takashi
2008-06-02 9:52 ` kamezawa.hiroyu
2008-05-30 1:46 ` [RFC][PATCH 2/2] memcg: memcg hierarchy KAMEZAWA Hiroyuki
2008-05-30 1:46 ` [RFC][PATCH 0/2] memcg: simple hierarchy (v2) Rik van Riel
2008-06-04 4:58 [RFC][PATCH 0/2] memcg: hierarchy support (v3) KAMEZAWA Hiroyuki
2008-06-04 5:01 ` [RFC][PATCH 1/2] memcg: res_counter hierarchy KAMEZAWA Hiroyuki
2008-06-04 6:54 ` Li Zefan
2008-06-04 7:03 ` KAMEZAWA Hiroyuki
2008-06-04 7:20 ` YAMAMOTO Takashi
2008-06-04 7:32 ` KAMEZAWA Hiroyuki
2008-06-04 8:59 ` Paul Menage
2008-06-04 9:18 ` KAMEZAWA Hiroyuki
2008-06-09 9:48 ` Balbir Singh
2008-06-09 10:20 ` KAMEZAWA Hiroyuki
2008-06-09 10:37 ` Balbir Singh
2008-06-11 23:24 ` Randy Dunlap
2008-06-12 4:59 ` KAMEZAWA Hiroyuki
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=4841886A.1000901@linux.vnet.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=xemul@openvz.org \
--cc=yamamoto@valinux.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