Re: [PATCH V8 1/2] mm: memcg softlimit reclaim rework

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

 



On 08/23/2012 02:27 AM, Ying Han wrote:
> 
> 
> On Tue, Aug 21, 2012 at 2:29 AM, Glauber Costa <glommer@xxxxxxxxxxxxx
> <mailto:glommer@xxxxxxxxxxxxx>> wrote:
> 
>     On 08/20/2012 10:30 PM, Ying Han wrote:
>     > Not exactly. Here reclaiming from root is mainly for "reclaiming from
>     > root's exclusive lru", which links the page includes:
>     > 1. processes running under root
>     > 2. reparented pages from rmdir memcg under root
>     > 3. bypassed pages
>     >
>     > Setting root cgroup's softlimit = 0 has the implication of putting
>     > those pages to likely to reclaim, which works fine. The question is
>     > that if no other memcg is above its softlimit, would it be a problem
>     > to adding a bit extra pressure to root which always is eligible for
>     > softlimit reclaim ( usage is always greater than softlimit).
>     >
>     > As an example, it works fine in our environment since we don't
>     > explicitly put any process under root. Most of  the pages linked in
>     > root lru would be reparented pages which should be reclaimed prior to
>     > others.
> 
>     Keep in mind that not all environments will be specialized to the point
>     of having root memcg empty. This basically treats root memcg as a trash
>     bin, and can be very detrimental to use cases where actual memory is
>     present in there.
> 
>     It would maybe be better to have all this garbage to go to a separate
>     place, like a shadow garbage memcg, which is invisible to the
>     filesystem, and is always the first to be reclaimed from, in any
>     circumstance.
> 
> 
> We can certainly do something like that, and actually we have the
> *special* cgroup setup today in google's environment. It is mainly
> targeting for pages that are allocated not on behalf of applications,
> but more of 
> system maintainess overhead. One example would be kernel thread memory
> charging.
> 
> In this case, it might make sense to put those reparented pages to
> a separate cgroup. However I do wonder with the following questions:
> 
> 1.  it might only make sense to do that if something else running under
> root. As we know, root is kind of special in memcg where there is no
> limit on it. So I wonder what would be the real life use case to put
> something under root?
> 

It is a common desktop environment cgroups usage to separate some
special processes only in memcg, and bind their memory usage. This is
even mentioned in the docs as an example case, if I recall correctly.

Systemd, for instance, places all services in cgroups. All the rest of
the system, applications user launches, etc, would live in the root memcg.

> 2.  even the reparented pages are mixed together with pages from process
> running under root, the LRU mechanism should still take effect of
> evicting cold pages first. if the reparent pages are the left-over pages
> from the removed cgroups, I would assume they are the candidate to
> reclaim first.
> 

I think this is a big assumption. To begin with, pages *just* reparented
will still be hot. They can be a lot.

> I am curious that in your environment, do you have things running root? 
> 
Our environment is also pretty easy, in the sense that all processes
that matters lives in a cgroup, 1 per-container. But say the admin wants
to install a management deamon, for instance, it won't necessarily be
accounted.

In any case, our use case is not my top concern here. Rather, it is the
general usage for people other than us.

--
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]