From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 28 Mar 2008 19:55:16 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [-mm] Add an owner to the mm_struct (v2) Message-Id: <20080328195516.494edde3.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20080328082316.6961.29044.sendpatchset@localhost.localdomain> References: <20080328082316.6961.29044.sendpatchset@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Balbir Singh Cc: Paul Menage , Pavel Emelianov , Hugh Dickins , Sudhir Kumar , YAMAMOTO Takashi , lizf@cn.fujitsu.com, linux-kernel@vger.kernel.org, taka@valinux.co.jp, linux-mm@kvack.org, David Rientjes , Andrew Morton List-ID: On Fri, 28 Mar 2008 13:53:16 +0530 Balbir Singh wrote: > -static struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) > +struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) > { > return container_of(task_subsys_state(p, mem_cgroup_subsys_id), > struct mem_cgroup, css); > @@ -250,12 +250,17 @@ void mm_init_cgroup(struct mm_struct *mm > > mem = mem_cgroup_from_task(p); > css_get(&mem->css); > - mm->mem_cgroup = mem; > } > > void mm_free_cgroup(struct mm_struct *mm) > { > - css_put(&mm->mem_cgroup->css); > + struct mem_cgroup *mem; > + > + /* > + * TODO: Should we assign mm->owner to NULL here? > + */ > + mem = mem_cgroup_from_task(rcu_dereference(mm->owner)); > + css_put(&mem->css); > } > How about changing this css_get()/css_put() from accounting against mm_struct to accouting against task_struct ? It seems simpler way after this mm->owner change. 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