From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with SMTP id 66E836B004F for ; Mon, 22 Jun 2009 20:02:50 -0400 (EDT) Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n5N02pt3011397 for (envelope-from kamezawa.hiroyu@jp.fujitsu.com); Tue, 23 Jun 2009 09:02:52 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 7AA7145DE51 for ; Tue, 23 Jun 2009 09:02:51 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 5297245DE4E for ; Tue, 23 Jun 2009 09:02:51 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 2D0FB1DB8038 for ; Tue, 23 Jun 2009 09:02:51 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id D81741DB8040 for ; Tue, 23 Jun 2009 09:02:50 +0900 (JST) Date: Tue, 23 Jun 2009 09:01:16 +0900 From: KAMEZAWA Hiroyuki Subject: Re: Low overhead patches for the memory cgroup controller (v5) Message-Id: <20090623090116.556d4f97.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20090622154343.9cdbf23a.akpm@linux-foundation.org> References: <20090615043900.GF23577@balbir.in.ibm.com> <20090622154343.9cdbf23a.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Andrew Morton Cc: balbir@linux.vnet.ibm.com, kamezawa.hiroyuki@jp.fujitsu.com, nishimura@mxp.nes.nec.co.jp, lizf@cn.fujitsu.com, menage@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org List-ID: On Mon, 22 Jun 2009 15:43:43 -0700 Andrew Morton wrote: > On Mon, 15 Jun 2009 10:09:00 +0530 > Balbir Singh wrote: > > > > > ... > > > > This patch changes the memory cgroup and removes the overhead associated > > with accounting all pages in the root cgroup. As a side-effect, we can > > no longer set a memory hard limit in the root cgroup. > > > > A new flag to track whether the page has been accounted or not > > has been added as well. Flags are now set atomically for page_cgroup, > > pcg_default_flags is now obsolete and removed. > > > > ... > > > > @@ -1114,9 +1121,22 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem, > > css_put(&mem->css); > > return; > > } > > + > > pc->mem_cgroup = mem; > > smp_wmb(); > > - pc->flags = pcg_default_flags[ctype]; > > + switch (ctype) { > > + case MEM_CGROUP_CHARGE_TYPE_CACHE: > > + case MEM_CGROUP_CHARGE_TYPE_SHMEM: > > + SetPageCgroupCache(pc); > > + SetPageCgroupUsed(pc); > > + break; > > + case MEM_CGROUP_CHARGE_TYPE_MAPPED: > > + ClearPageCgroupCache(pc); > > + SetPageCgroupUsed(pc); > > + break; > > + default: > > + break; > > + } > > Do we still need the smp_wmb()? > > It's hard to say, because we forgot to document it :( > Sorry for lack of documentation. pc->mem_cgroup should be visible before SetPageCgroupUsed(). Othrewise, A routine believes USED bit will see bad pc->mem_cgroup. I'd like to add a comment later (againt new mmotm.) Thanks, -Kame -- 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/ . Don't email: email@kvack.org