Re: memcg: softlimit on internal nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[I am terribly jet lagged so I should probably postpone any serious
thinking for few days but let me try]

On Sat 20-04-13 19:23:21, Tejun Heo wrote:
> Hello, Michal.
> 
> On Fri, Apr 19, 2013 at 08:16:11PM -0700, Michal Hocko wrote:
> > > For example, please consider the following hierarchy where s denotes
> > > the "softlimit" and h hardlimit.
> > > 
> > >       A (h:8G s:4G)
> > >      /            \
> > >     /              \
> > >  B (h:5G s:1G)    C (h:5G s:1G)
> ...
> > > It must not be any different for "softlimit".  If B or C are
> > > individually under 1G, they won't be targeted by the reclaimer and
> > > even if B and C are over 1G, let's say 2G, as long as the sum is under
> > > A's "softlimit" - 4G, reclaimer won't look at them. 
> > 
> > But we disagree on this one. If B and/or C are above their soft limit
> > we do (soft) reclaim them. It is exactly the same thing as if they were
> > hitting their hard limit (we just enforce the limit lazily).
> > 
> > You can look at the soft limit as a lazy limit which is enforced only if
> > there is an external pressure coming up the hierarchy - this can be
> > either global memory presure or a hard limit reached up the hierarchy.
> > Does this makes sense to you?
> 
> When flat, there's no confusion.  The problem is that what you
> describe makes the meaning of softlimit different for internal nodes
> and leaf nodes.

No inter and leaf nodes behave very same. Have a look at
mem_cgroup_soft_reclaim_eligible. All the confusion comes probably
from the understanding of the current semantic of what soft limit and
what it should do after my patch.
The current implementation stores all subtrees that are over the soft
limit in a tree sorted by how much they are excessing the limit. Have
a look at mem_cgroup_update_tree and its callers (namely down from
__mem_cgroup_commit_charge). My patch _preserves_ this behavior it just
makes the code much saner and as a bonus it doesn't touch groups (not
hierarchies) under the limit unless necessary which wasn't the case
previously.
So yes, I can understand why this is confusing for you. The soft limit
semantic is different because the limit is/was considered only if it
is/was in excess.

Maybe I was using word _guarantee_ too often to confuse you, I am sorry
if this is the case. The guarantee part comes from the group point of
view. So the original semantic of the hierarchical behavior is
unchanged.

What to does it mean that an inter node is under the soft limit
for the subhierarchy is questionable and there are usecases where
children groups might be under control of a different (even untrusted)
administrators (think about containers) so the implementation is not
straight forward. We certainly can do better than just reclaim everybody
but this is a subject to later improvements.

I will get to the rest of the email later.
[...]
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]