Re: [PATCH] memcg: implement low limits

2013-02-28 Thread Michal Hocko
On Wed 27-02-13 18:57:32, Roman Gushchin wrote: [...] > >>  + * > >>  + */ > >>  +unsigned int mem_cgroup_low_limit_scale(struct lruvec *lruvec) > >>  +{ > >>  + struct mem_cgroup_per_zone *mz; > >>  + struct mem_cgroup *memcg; > >>  + unsigned long long low_limit; > >>  + unsigned long long usage;

Re: [PATCH] memcg: implement low limits

2013-02-28 Thread Michal Hocko
On Thu 28-02-13 15:13:15, Roman Gushchin wrote: > 27.02.2013, 20:14, "Michal Hocko" : > > On Wed 27-02-13 14:39:36, Roman Gushchin wrote: [...] > >>  2) cgroup's prioritization during global reclaim, > > > > Yes, group priorities sound like a useful feature not just for the > > reclaim I would like

Re: [PATCH] memcg: implement low limits

2013-02-28 Thread Roman Gushchin
27.02.2013, 20:14, "Michal Hocko" : > On Wed 27-02-13 14:39:36, Roman Gushchin wrote: > >>  27.02.2013, 13:41, "Michal Hocko" : >>>  Let me restate what I have already mentioned in the private >>>  communication. >>> >>>  We already have soft limit which can be implemented to achieve the >>>  same/

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Michal Hocko
On Wed 27-02-13 14:39:36, Roman Gushchin wrote: > 27.02.2013, 13:41, "Michal Hocko" : > > Let me restate what I have already mentioned in the private > > communication. > > > > We already have soft limit which can be implemented to achieve the > > same/similar functionality and in fact this is a lo

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Roman Gushchin
Please find my comments below. > More comments on the code bellow. > > [...] > >>  diff --git a/mm/memcontrol.c b/mm/memcontrol.c >>  index 53b8201..d8e6ee6 100644 >>  --- a/mm/memcontrol.c >>  +++ b/mm/memcontrol.c >>  @@ -1743,6 +1743,53 @@ static void mem_cgroup_out_of_memory(struct >> mem_cgr

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Roman Gushchin
27.02.2013, 13:41, "Michal Hocko" : > Let me restate what I have already mentioned in the private > communication. > > We already have soft limit which can be implemented to achieve the > same/similar functionality and in fact this is a long term objective (at > least for me). I hope I will be able

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Roman Gushchin
> So the new low limit is not a rigid limit.  Global reclaim can reclaim > from a cgroup when its usage is below low_limit_in_bytes although such > reclaim is less aggressive than when usage is above low_limit_in_bytes. > Correct? That's true. But such reclaim occurs only on very small reclaiming

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Michal Hocko
On Wed 27-02-13 12:02:36, Roman Gushchin wrote: > Hi, all! > > I've implemented low limits for memory cgroups. The primary goal was > to add an ability to protect some memory from reclaiming without using > mlock(). A kind of "soft mlock()". Let me restate what I have already mentioned in the pri

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Greg Thelen
On Wed, Feb 27 2013, Roman Gushchin wrote: > Hi, all! > > I've implemented low limits for memory cgroups. The primary goal was to add > an ability > to protect some memory from reclaiming without using mlock(). A kind of "soft > mlock()". > > I think this patch will be helpful when it's necessa

[PATCH] memcg: implement low limits

2013-02-27 Thread Roman Gushchin
Hi, all! I've implemented low limits for memory cgroups. The primary goal was to add an ability to protect some memory from reclaiming without using mlock(). A kind of "soft mlock()". I think this patch will be helpful when it's necessary to protect production processes from memory-wasting ba