From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx101.postini.com [74.125.245.101]) by kanga.kvack.org (Postfix) with SMTP id 74D3E6B005C for ; Thu, 19 Jul 2012 05:45:11 -0400 (EDT) Date: Thu, 19 Jul 2012 12:45:54 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH] mm/memcg: wrap mem_cgroup_from_css function Message-ID: <20120719094554.GA2701@shutemov.name> References: <1342580730-25703-1-git-send-email-liwanp@linux.vnet.ibm.com> <20120719091420.GA2549@shutemov.name> <20120719092309.GA12409@kernel> <20120719093835.GA3776@shangw.(null)> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120719093835.GA3776@shangw.(null)> Sender: owner-linux-mm@kvack.org List-ID: To: Gavin Shan Cc: Wanpeng Li , linux-mm@kvack.org, Michal Hocko , Johannes Weiner , KAMEZAWAHiroyuki , Andrew Morton , linux-kernel@vger.kernel.org On Thu, Jul 19, 2012 at 05:38:35PM +0800, Gavin Shan wrote: > On Thu, Jul 19, 2012 at 05:23:09PM +0800, Wanpeng Li wrote: > >On Thu, Jul 19, 2012 at 12:14:20PM +0300, Kirill A. Shutemov wrote: > >>On Wed, Jul 18, 2012 at 11:05:30AM +0800, Wanpeng Li wrote: > >>> wrap mem_cgroup_from_css function to clarify get mem cgroup > >>> from cgroup_subsys_state. > >>> > >>> Signed-off-by: Wanpeng Li > >>> Cc: Michal Hocko > >>> Cc: Johannes Weiner > >>> Cc: KAMEZAWA Hiroyuki > >>> Cc: Andrew Morton > >>> Cc: Gavin Shan > >>> Cc: Wanpeng Li > >>> Cc: linux-kernel@vger.kernel.org > >>> --- > >>> mm/memcontrol.c | 14 ++++++++++---- > >>> 1 files changed, 10 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c > >>> index 58a08fc..20f6a15 100644 > >>> --- a/mm/memcontrol.c > >>> +++ b/mm/memcontrol.c > >>> @@ -396,6 +396,12 @@ static void mem_cgroup_put(struct mem_cgroup *memcg); > >>> #include > >>> #include > >>> > >>> +static inline > >>> +struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s) > >>> +{ > >>> + return container_of(s, struct mem_cgroup, css); > >>> +} > >>> + > >>> static bool mem_cgroup_is_root(struct mem_cgroup *memcg); > >>> void sock_update_memcg(struct sock *sk) > >>> { > >>> @@ -820,7 +826,7 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) > >>> > >>> struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont) > >>> { > >>> - return container_of(cgroup_subsys_state(cont, > >>> + return mem_cgroup_from_css(cgroup_subsys_state(cont, > >>> mem_cgroup_subsys_id), struct mem_cgroup, > >>> css); > >> > >>Hm?.. Here and below too many args to mem_cgroup_from_css(). > >>Have you tested the code? > > > >Hi, what's the meaning of "two many"? > > > > It might be the typo for "two" here. Oops.. You're right. -- Kirill A. Shutemov -- 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