On Mon, 7 Feb 2011 18:13:22 -0800 (PST) David Rientjes <rientjes@xxxxxxxxxx> wrote: > On Tue, 8 Feb 2011, KAMEZAWA Hiroyuki wrote: > > > > +static int mem_cgroup_oom_delay_millisecs_write(struct cgroup *cgrp, > > > + struct cftype *cft, u64 val) > > > +{ > > > + struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp); > > > + struct mem_cgroup *iter; > > > + > > > + if (val > MAX_SCHEDULE_TIMEOUT) > > > + return -EINVAL; > > > + > > > + for_each_mem_cgroup_tree(iter, memcg) { > > > + iter->oom_delay = msecs_to_jiffies(val); > > > + memcg_oom_recover(iter); > > > + } > > > + return 0; > > > > Seems nicer and it seems you tries to update all children cgroups. > > > > BTW, with above code, with following heirarchy, > > > > A > > / > > B > > / > > C > > > > When a user set oom_delay in order as A->B->C, A,B,C can have 'different' numbers. > > When a user set oom_delay in order as C->B->A, A,B,C will have the same numbers. > > > > This intreface seems magical, or broken. > > > > It's not really magical, it just means that if you change the delay for a > memcg that you do so for all of its children implicitly as well. > But you didn't explain the bahavior in Documenation. > An alternative would be to ensure that a child memcg may never have a > delay greater than the delay of its parent. Would you prefer that > instead? > I don't think such limitation makes sense. My point is just that the behavior is very special in current memcg interfaces. They do - It's not allowed to set attribute to no-children, no-parent cgroup So, please explain above behavior in Documenation. Thanks, -Kame -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>