Thread (110 messages) 110 messages, 8 authors, 2011-09-21

Re: [patch 2/8] mm: memcg-aware global reclaim

From: Johannes Weiner <hannes@cmpxchg.org>
Date: 2011-09-21 08:44:45
Also in: lkml

Hi Ying,

On Wed, Aug 31, 2011 at 03:58:09PM -0700, Ying Han wrote:
On Tue, Aug 30, 2011 at 8:14 AM, Johannes Weiner [off-list ref] wrote:
quoted
On Tue, Aug 30, 2011 at 12:07:07AM -0700, Ying Han wrote:
quoted
On Mon, Aug 29, 2011 at 2:05 PM, Johannes Weiner [off-list ref] wrote:
quoted
I have now the following comment in mem_cgroup_lru_del_list():

       /*
        * root_mem_cgroup babysits uncharged LRU pages, but
        * PageCgroupUsed is cleared when the page is about to get
        * freed.  PageCgroupAcctLRU remembers whether the
        * LRU-accounting happened against pc->mem_cgroup or
        * root_mem_cgroup.
        */

Does that answer your question?  If not, please tell me, so I can fix
the comment :-)
Sorry, not clear to me yet :(

Is this saying that we can not differentiate the page linked to root
but not charged vs
page linked to memcg which is about to be freed.

If that is the case, isn't the page being removed from lru first
before doing uncharge (ClearPageCgroupUsed) ?
Sorry for getting back to this late.
quoted
It depends.  From the reclaim path, yes.  But it may be freed through
__page_cache_release() for example, which unlinks after uncharge.
That is true. And the comment start making senses to me. Thanks.

The problem here is the inconsistency of the pc->mem_cgroup and
page->lru for uncharged pages ( !Used). And even further, that is
caused by (only?) pages silently floating from memcg lru
to root lru after they are uncharged (before they are freed). And I
wonder those pages will be short lived.

Guess my question is why those pages have to travel to root and then
freed quickly, and we just leave them in the memcg lru?
That's not what happens.  If they get reclaimed, they are first
removed from the LRU (isolated), then freed.  If they get truncated
OTOH, they get uncharged in delete_from_page_cache() and unlinked from
the LRU on the final put_page().  There is no moving around in
between.

The moving to root_mem_cgroup happens to rescue the lru-account from
pc->mem_cgroup of an LRU page before pc->mem_cgroup is overwritten, so
it is only applicable to pages that are charged while on the LRU.
PageCgroupAcctLRU indicates whether a PageLRU page is lru-accounted to
pc->mem_cgroup (set) or root_mem_cgroup (clear).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  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@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help