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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110602175702.GI28684@cmpxchg.org>
Date:	Thu, 2 Jun 2011 19:57:02 +0200
From:	Johannes Weiner <hannes@...xchg.org>
To:	Hiroyuki Kamezawa <kamezawa.hiroyuki@...il.com>
Cc:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Ying Han <yinghan@...gle.com>, 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
Subject: Re: [patch 8/8] mm: make per-memcg lru lists exclusive

On Fri, Jun 03, 2011 at 12:54:39AM +0900, Hiroyuki Kamezawa wrote:
> 2011/6/2 Johannes Weiner <hannes@...xchg.org>:
> > On Thu, Jun 02, 2011 at 10:16:59PM +0900, Hiroyuki Kamezawa wrote:
> >> 2011/6/1 Johannes Weiner <hannes@...xchg.org>:
> >> > All lru list walkers have been converted to operate on per-memcg
> >> > lists, the global per-zone lists are no longer required.
> >> >
> >> > This patch makes the per-memcg lists exclusive and removes the global
> >> > lists from memcg-enabled kernels.
> >> >
> >> > The per-memcg lists now string up page descriptors directly, which
> >> > unifies/simplifies the list isolation code of page reclaim as well as
> >> > it saves a full double-linked list head for each page in the system.
> >> >
> >> > At the core of this change is the introduction of the lruvec
> >> > structure, an array of all lru list heads.  It exists for each zone
> >> > globally, and for each zone per memcg.  All lru list operations are
> >> > now done in generic code against lruvecs, with the memcg lru list
> >> > primitives only doing accounting and returning the proper lruvec for
> >> > the currently scanned memcg on isolation, or for the respective page
> >> > on putback.
> >> >
> >> > Signed-off-by: Johannes Weiner <hannes@...xchg.org>
> >>
> >>
> >> could you divide this into
> >>   - introduce lruvec
> >>   - don't record section? information into pc->flags because we see
> >> "page" on memcg LRU
> >>     and there is no requirement to get page from "pc".
> >>   - remove pc->lru completely
> >
> > Yes, that makes sense.  It shall be fixed in the next version.
> >
> 
> BTW, IIUC, Transparent hugepage has a code to link a page to the
> page->lru directly.

[...]

> But it may put a page onto wrong memcgs if we do link a page to
> another page's page->lru
> because 2 pages may be in different cgroup each other.

Yes, I noticed that.  If it splits a huge page, it does not just add
the tailpages to the lru head, but it links them next to the head
page.

But I don't see how those pages could ever be in different memcgs?
pages with page->mapping pointing to the same anon_vma are always in
the same memcg, AFAIU.  Only since broken COWs get their own, though.

> 
> Could you check there are more codes which does link page->lru to nearby page's
> page->lru ? Now, I'm not sure there are other codes....but we need care.

I double check again.  It's a tricky area, but I thought I covered all
cases.  Never hurts to reassure, though.

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