lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110921084403.GA22516@cmpxchg.org>
Date:	Wed, 21 Sep 2011 10:44:03 +0200
From:	Johannes Weiner <hannes@...xchg.org>
To:	Ying Han <yinghan@...gle.com>
Cc:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
	Michal Hocko <mhocko@...e.cz>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>,
	Minchan Kim <minchan.kim@...il.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Mel Gorman <mgorman@...e.de>, Greg Thelen <gthelen@...gle.com>,
	Michel Lespinasse <walken@...gle.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, Hugh Dickins <hughd@...gle.com>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>
Subject: Re: [patch 2/8] mm: memcg-aware global reclaim

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 <hannes@...xchg.org> wrote:
> > On Tue, Aug 30, 2011 at 12:07:07AM -0700, Ying Han wrote:
> >> On Mon, Aug 29, 2011 at 2:05 PM, Johannes Weiner <hannes@...xchg.org> wrote:
> >> > 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.
> 
> > 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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ