[Devel] Re: [PATCH 2/2] Make res_counter hierarchical

2008-03-11 Thread Balbir Singh
Pavel Emelyanov wrote: Balbir Singh wrote: Pavel Emelyanov wrote: This allows us two things basically: 1. If the subgroup has the limit higher than its parent has then the one will get more memory than allowed. But should we allow such configuration? I suspect that we should catch such

[Devel] Re: [PATCH 2/2] Make res_counter hierarchical

2008-03-11 Thread Pavel Emelyanov
Balbir Singh wrote: Pavel Emelyanov wrote: This allows us two things basically: 1. If the subgroup has the limit higher than its parent has then the one will get more memory than allowed. But should we allow such configuration? I suspect that we should catch such things at the time of

[Devel] Re: [PATCH 2/2] Make res_counter hierarchical

2008-03-11 Thread Pavel Emelyanov
Balbir Singh wrote: Pavel Emelyanov wrote: Balbir Singh wrote: Pavel Emelyanov wrote: This allows us two things basically: 1. If the subgroup has the limit higher than its parent has then the one will get more memory than allowed. But should we allow such configuration? I suspect that

[Devel] Re: [PATCH 2/2] Make res_counter hierarchical

2008-03-11 Thread Paul Menage
On Tue, Mar 11, 2008 at 1:15 AM, Pavel Emelyanov [EMAIL PROTECTED] 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 +

[Devel] Re: [PATCH 1/2] Add the max_usage member on the res_counter

2008-03-11 Thread Pavel Emelyanov
KAMEZAWA Hiroyuki wrote: On Fri, 07 Mar 2008 18:30:55 +0300 Pavel Emelyanov [EMAIL PROTECTED] wrote: This is a very usefull feature. E.g. one may set the limit to unlimited value and check for the memory requirements of a new container. Hm, I like this. Could you add a method to reset

[Devel] Re: [PATCH 2/2] Make res_counter hierarchical

2008-03-11 Thread KAMEZAWA Hiroyuki
On Tue, 11 Mar 2008 14:46:58 +0530 Balbir Singh [EMAIL PROTECTED] wrote: Paul Menage wrote: On Tue, Mar 11, 2008 at 2:13 AM, KAMEZAWA Hiroyuki [EMAIL PROTECTED] wrote: or remove all relationship among counters of *different* type of resources. user-land-daemon will do enough jobs.

[Devel] Re: [PATCH 2/3] memcg: put a restriction on writing memory.force_empty

2008-03-11 Thread Balbir Singh
Li Zefan wrote: We can write whatever to memory.force_empty: echo 999 memory.force_empty echo wow memory.force_empty This is odd, so let's make '1' to be the only valid value. I suspect as long as there is no unreasonable side-effect, writing 999 or wow should be OK. --

[Devel] [PATCH 1/3] res_counter: introduce res_counter_write_u64()

2008-03-11 Thread Li Zefan
This function can be used to assign the value of a resource counter member. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- include/linux/res_counter.h |9 ++--- kernel/res_counter.c|9 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git

[Devel] Re: [PATCH 3/3] memcgoup: allow memory.failcnt to be reset

2008-03-11 Thread Balbir Singh
KAMEZAWA Hiroyuki wrote: On Tue, 11 Mar 2008 19:09:02 +0900 Li Zefan [EMAIL PROTECTED] wrote: Allow memory.failcnt to be reset to 0: echo 0 memory.failcnt And '0' is the only valid value. Can't this be generic resource counter function ? I was about to suggest a generic

[Devel] Re: [PATCH 1/3] res_counter: introduce res_counter_write_u64()

2008-03-11 Thread KAMEZAWA Hiroyuki
On Tue, 11 Mar 2008 19:08:39 +0900 Li Zefan [EMAIL PROTECTED] wrote: This function can be used to assign the value of a resource counter member. Why don't you make this function to do the same work as res_counter_write() ? Thanks, -Kame Signed-off-by: Li Zefan [EMAIL PROTECTED] ---

[Devel] Re: [RFC][PATCH 4/4] PID: use the target ID specified in procfs

2008-03-11 Thread Pavel Emelyanov
[EMAIL PROTECTED] wrote: @@ -122,14 +122,26 @@ static void free_pidmap(struct upid *upi atomic_inc(map-nr_free); } -static int alloc_pidmap(struct pid_namespace *pid_ns) +static int alloc_pidmap(struct pid_namespace *pid_ns, struct pid_list *pid_l, + int level)

[Devel] Re: [RFC][PATCH 4/4] PID: use the target ID specified in procfs

2008-03-11 Thread Nadia Derbey
Pavel Emelyanov wrote: [EMAIL PROTECTED] wrote: @@ -122,14 +122,26 @@ static void free_pidmap(struct upid *upi atomic_inc(map-nr_free); } -static int alloc_pidmap(struct pid_namespace *pid_ns) +static int alloc_pidmap(struct pid_namespace *pid_ns, struct pid_list *pid_l, +

[Devel] Re: [RFC][PATCH 4/4] PID: use the target ID specified in procfs

2008-03-11 Thread Pavel Emelyanov
Nadia Derbey wrote: Pavel Emelyanov wrote: [EMAIL PROTECTED] wrote: @@ -122,14 +122,26 @@ static void free_pidmap(struct upid *upi atomic_inc(map-nr_free); } -static int alloc_pidmap(struct pid_namespace *pid_ns) +static int alloc_pidmap(struct pid_namespace *pid_ns, struct pid_list

[Devel] Re: [RFC][PATCH 4/4] PID: use the target ID specified in procfs

2008-03-11 Thread Nadia Derbey
Pavel Emelyanov wrote: Nadia Derbey wrote: Pavel Emelyanov wrote: [EMAIL PROTECTED] wrote: @@ -122,14 +122,26 @@ static void free_pidmap(struct upid *upi atomic_inc(map-nr_free); } -static int alloc_pidmap(struct pid_namespace *pid_ns) +static int alloc_pidmap(struct pid_namespace

[Devel] Re: [PATCH 2/2] Make res_counter hierarchical

2008-03-11 Thread Balbir Singh
Paul Menage wrote: On Tue, Mar 11, 2008 at 2:16 AM, Balbir Singh [EMAIL PROTECTED] wrote: Paul Menage wrote: On Tue, Mar 11, 2008 at 2:13 AM, KAMEZAWA Hiroyuki [EMAIL PROTECTED] wrote: or remove all relationship among counters of *different* type of resources. user-land-daemon

[Devel] Re: [PATCH] Add a 'trigger' callback on struct cftype.

2008-03-11 Thread Paul Menage
On Tue, Mar 11, 2008 at 8:21 AM, Pavel Emelyanov [EMAIL PROTECTED] wrote: If the patch with max_usage for res_counter will be accepted we'll have two :) files, that a event-triggers essentially, i.e. they don't care what the user actually write to then, but are interested in the writing by

[Devel] Re: [PATCH] Add a 'trigger' callback on struct cftype.

2008-03-11 Thread Pavel Emelyanov
Paul Menage wrote: On Tue, Mar 11, 2008 at 9:13 AM, Pavel Emelyanov [EMAIL PROTECTED] wrote: --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -243,7 +243,7 @@ struct cftype { */ int (*write_s64) (struct cgroup *cgrp, struct cftype *cft, s64 val); -

[Devel] Re: [RFC][PATCH 4/4] PID: use the target ID specified in procfs

2008-03-11 Thread Pavel Emelyanov
Serge E. Hallyn wrote: Quoting Pavel Emelyanov ([EMAIL PROTECTED]): Nadia Derbey wrote: Pavel Emelyanov wrote: [EMAIL PROTECTED] wrote: @@ -122,14 +122,26 @@ static void free_pidmap(struct upid *upi atomic_inc(map-nr_free); } -static int alloc_pidmap(struct pid_namespace *pid_ns)

[Devel] Re: [RFC][PATCH 4/4] PID: use the target ID specified in procfs

2008-03-11 Thread Serge E. Hallyn
Quoting Pavel Emelyanov ([EMAIL PROTECTED]): Serge E. Hallyn wrote: Quoting Pavel Emelyanov ([EMAIL PROTECTED]): Nadia Derbey wrote: Pavel Emelyanov wrote: [EMAIL PROTECTED] wrote: @@ -122,14 +122,26 @@ static void free_pidmap(struct upid *upi atomic_inc(map-nr_free); }