From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with SMTP id 1079F6B005C for ; Wed, 14 Jan 2009 23:55:12 -0500 (EST) Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n0F4tBWh018820 for (envelope-from kamezawa.hiroyu@jp.fujitsu.com); Thu, 15 Jan 2009 13:55:11 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id C3B6845DE53 for ; Thu, 15 Jan 2009 13:55:10 +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 9614045DE4C for ; Thu, 15 Jan 2009 13:55:10 +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 3CF53E08006 for ; Thu, 15 Jan 2009 13:55:10 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id D048DE08004 for ; Thu, 15 Jan 2009 13:55:09 +0900 (JST) Date: Thu, 15 Jan 2009 13:54:05 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [RFC][PATCH 5/4] memcg: don't call res_counter_uncharge when obsolete Message-Id: <20090115135405.a15a6877.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20090115044557.GG21516@balbir.in.ibm.com> References: <20090113184533.6ffd2af9.nishimura@mxp.nes.nec.co.jp> <20090114175121.275ecd59.nishimura@mxp.nes.nec.co.jp> <20090114135539.GA21516@balbir.in.ibm.com> <20090115122416.e15d88a7.kamezawa.hiroyu@jp.fujitsu.com> <20090115041750.GE21516@balbir.in.ibm.com> <20090115134114.dba6b83a.kamezawa.hiroyu@jp.fujitsu.com> <20090115044557.GG21516@balbir.in.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: balbir@linux.vnet.ibm.com Cc: Daisuke Nishimura , LKML , linux-mm , Andrew Morton , Pavel Emelyanov , Li Zefan , Paul Menage List-ID: On Thu, 15 Jan 2009 10:15:57 +0530 Balbir Singh wrote: > * KAMEZAWA Hiroyuki [2009-01-15 13:41:14]: > > > On Thu, 15 Jan 2009 09:47:50 +0530 > > Balbir Singh wrote: > > > > > * KAMEZAWA Hiroyuki [2009-01-15 12:24:16]: > > > > > > But I don't like -EBUSY ;) > > > > > > > > When rmdir() returns -EBUSY even if there are no (visible) children and tasks, > > > > our customer will take kdump and send it to me "please explain this kernel bug" > > > > > > > > I'm sure it will happen ;) > > > > > > > > > > OK, but memory.stat can show why the group is busy and with > > > move_to_parent() such issues should not occur right? I'll relook at > > > the code. Thanks for your input. > > > > > > > There was a design choice at swap_cgroup. > > > > At rmdir, there may be used swap entry in memcg. (mem->memsw.usage can be > 0) > > 1. update all records in swap cgroup > > 2. just ignore account from swap, we can treat then at swap-in. > > > > I implemented "2" by refcnt. > > > > To do "1", we have to scan all used swap_cgroup but I don't want to scan all > > swap_cgroup entry at rmdir. It's heavy job. > > (*) To reduce memory usage by swap_cgroup, swap_cgroup just have a pointer to memcg > > (**) I implemented swap_cgroup as statically allocated array because I don't want > > any dynamic memory allocation at swap-out and want to avoid unnecessary memory > > usage. > > Fair enough, but I don't like that we don't have any checks for > > If parent still has children, parent should not go away. The > problem that Daisuke-San is seeing. > The parent has "no children" in cgroup layer. It just has children in "memory subsys" layer. It's better to add mem_cgroup_get()/put agaisnt the parent at create()/destroy(). I'm now preparing a patch. -Kame > -- > Balbir > -- 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