From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753841Ab2GJGKz (ORCPT ); Tue, 10 Jul 2012 02:10:55 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:63692 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752329Ab2GJGKx (ORCPT ); Tue, 10 Jul 2012 02:10:53 -0400 Date: Tue, 10 Jul 2012 14:10:21 +0800 From: Wanpeng Li To: Johannes Weiner Cc: Michal Hocko , Andrew Morton , KAMEZAWA Hiroyuki , Hugh Dickins , David Rientjes , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: Re: [patch 08/11] mm: memcg: remove needless !mm fixup to init_mm when charging Message-ID: <20120710061021.GA6096@kernel> Reply-To: Wanpeng Li References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-9-git-send-email-hannes@cmpxchg.org> <20120709152058.GK4627@tiehlicka.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120709152058.GK4627@tiehlicka.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2012 at 05:20:58PM +0200, Michal Hocko wrote: >On Thu 05-07-12 02:45:00, Johannes Weiner wrote: >> It does not matter to __mem_cgroup_try_charge() if the passed mm is >> NULL or init_mm, it will charge the root memcg in either case. You can also change the comment in __mem_cgroup_try_charge : "if so charge the init_mm" => "if so charge the root memcg" >> >> Signed-off-by: Johannes Weiner > >Acked-by: Michal Hocko > >> --- >> mm/memcontrol.c | 5 ----- >> 1 files changed, 0 insertions(+), 5 deletions(-) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 418b47d..6fe4101 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -2766,8 +2766,6 @@ int mem_cgroup_try_charge_swapin(struct mm_struct *mm, >> ret = 0; >> return ret; >> charge_cur_mm: >> - if (unlikely(!mm)) >> - mm = &init_mm; >> ret = __mem_cgroup_try_charge(mm, mask, 1, memcgp, true); >> if (ret == -EINTR) >> ret = 0; >> @@ -2832,9 +2830,6 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, >> if (PageCompound(page)) >> return 0; >> >> - if (unlikely(!mm)) >> - mm = &init_mm; >> - >> if (!PageSwapCache(page)) >> ret = mem_cgroup_charge_common(page, mm, gfp_mask, type); >> else { /* page is swapcache/shmem */ >> -- >> 1.7.7.6 >> > >-- >Michal Hocko >SUSE Labs >SUSE LINUX s.r.o. >Lihovarska 1060/12 >190 00 Praha 9 >Czech Republic >-- >To unsubscribe from this list: send the line "unsubscribe cgroups" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx140.postini.com [74.125.245.140]) by kanga.kvack.org (Postfix) with SMTP id 931976B006C for ; Tue, 10 Jul 2012 02:10:53 -0400 (EDT) Received: by pbbrp2 with SMTP id rp2so24760591pbb.14 for ; Mon, 09 Jul 2012 23:10:52 -0700 (PDT) Date: Tue, 10 Jul 2012 14:10:21 +0800 From: Wanpeng Li Subject: Re: [patch 08/11] mm: memcg: remove needless !mm fixup to init_mm when charging Message-ID: <20120710061021.GA6096@kernel> Reply-To: Wanpeng Li References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-9-git-send-email-hannes@cmpxchg.org> <20120709152058.GK4627@tiehlicka.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120709152058.GK4627@tiehlicka.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Michal Hocko , Andrew Morton , KAMEZAWA Hiroyuki , Hugh Dickins , David Rientjes , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li On Mon, Jul 09, 2012 at 05:20:58PM +0200, Michal Hocko wrote: >On Thu 05-07-12 02:45:00, Johannes Weiner wrote: >> It does not matter to __mem_cgroup_try_charge() if the passed mm is >> NULL or init_mm, it will charge the root memcg in either case. You can also change the comment in __mem_cgroup_try_charge : "if so charge the init_mm" => "if so charge the root memcg" >> >> Signed-off-by: Johannes Weiner > >Acked-by: Michal Hocko > >> --- >> mm/memcontrol.c | 5 ----- >> 1 files changed, 0 insertions(+), 5 deletions(-) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 418b47d..6fe4101 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -2766,8 +2766,6 @@ int mem_cgroup_try_charge_swapin(struct mm_struct *mm, >> ret = 0; >> return ret; >> charge_cur_mm: >> - if (unlikely(!mm)) >> - mm = &init_mm; >> ret = __mem_cgroup_try_charge(mm, mask, 1, memcgp, true); >> if (ret == -EINTR) >> ret = 0; >> @@ -2832,9 +2830,6 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, >> if (PageCompound(page)) >> return 0; >> >> - if (unlikely(!mm)) >> - mm = &init_mm; >> - >> if (!PageSwapCache(page)) >> ret = mem_cgroup_charge_common(page, mm, gfp_mask, type); >> else { /* page is swapcache/shmem */ >> -- >> 1.7.7.6 >> > >-- >Michal Hocko >SUSE Labs >SUSE LINUX s.r.o. >Lihovarska 1060/12 >190 00 Praha 9 >Czech Republic >-- >To unsubscribe from this list: send the line "unsubscribe cgroups" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wanpeng Li Subject: Re: [patch 08/11] mm: memcg: remove needless !mm fixup to init_mm when charging Date: Tue, 10 Jul 2012 14:10:21 +0800 Message-ID: <20120710061021.GA6096@kernel> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-9-git-send-email-hannes@cmpxchg.org> <20120709152058.GK4627@tiehlicka.suse.cz> Reply-To: Wanpeng Li Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=k+G4GdLxOw1da0kuIVrk1Pu2E8/bG12ZdSc4pYbDaHI=; b=UwkqHcCGaVtXWfaYIQY005Qw7WxglA0s9nz6uJGVCc30QMVbMYfjl+pRFqhkOWksNB IGLtb9pb5c2rXaHQdUL7QKOCUtkYPcusNQoF2QqoSPuonFyrXFDHlJp4CYrbNAk90RKo iV8EHVMtAd478wx51hoNLe0ti1FhVXwgva1t5NjcyKAiVyN9DW+YcsQkYPRZalLdE+Sx NFtL3QgIZ77xkUn71w0c+rv5bdDkJkcAJIPbX0sXI0l1Oo1aC6tDqA1uUh8X9l2spu33 T4MVXuuau2UcZIVIkx6lKh5ImxJQGvBUWIGLrPUFpdrqLnWWBwG46c3mXP75bBr2yjYh ak4Q== Content-Disposition: inline In-Reply-To: <20120709152058.GK4627-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Johannes Weiner Cc: Michal Hocko , Andrew Morton , KAMEZAWA Hiroyuki , Hugh Dickins , David Rientjes , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Wanpeng Li On Mon, Jul 09, 2012 at 05:20:58PM +0200, Michal Hocko wrote: >On Thu 05-07-12 02:45:00, Johannes Weiner wrote: >> It does not matter to __mem_cgroup_try_charge() if the passed mm is >> NULL or init_mm, it will charge the root memcg in either case. You can also change the comment in __mem_cgroup_try_charge : "if so charge the init_mm" => "if so charge the root memcg" >> >> Signed-off-by: Johannes Weiner > >Acked-by: Michal Hocko > >> --- >> mm/memcontrol.c | 5 ----- >> 1 files changed, 0 insertions(+), 5 deletions(-) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 418b47d..6fe4101 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -2766,8 +2766,6 @@ int mem_cgroup_try_charge_swapin(struct mm_struct *mm, >> ret = 0; >> return ret; >> charge_cur_mm: >> - if (unlikely(!mm)) >> - mm = &init_mm; >> ret = __mem_cgroup_try_charge(mm, mask, 1, memcgp, true); >> if (ret == -EINTR) >> ret = 0; >> @@ -2832,9 +2830,6 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, >> if (PageCompound(page)) >> return 0; >> >> - if (unlikely(!mm)) >> - mm = &init_mm; >> - >> if (!PageSwapCache(page)) >> ret = mem_cgroup_charge_common(page, mm, gfp_mask, type); >> else { /* page is swapcache/shmem */ >> -- >> 1.7.7.6 >> > >-- >Michal Hocko >SUSE Labs >SUSE LINUX s.r.o. >Lihovarska 1060/12 >190 00 Praha 9 >Czech Republic >-- >To unsubscribe from this list: send the line "unsubscribe cgroups" in >the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >More majordomo info at http://vger.kernel.org/majordomo-info.html