From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752583Ab2GIHga (ORCPT ); Mon, 9 Jul 2012 03:36:30 -0400 Received: from zene.cmpxchg.org ([85.214.230.12]:53714 "EHLO zene.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752454Ab2GIHg2 (ORCPT ); Mon, 9 Jul 2012 03:36:28 -0400 Date: Mon, 9 Jul 2012 09:36:14 +0200 From: Johannes Weiner To: Kamezawa Hiroyuki Cc: Andrew Morton , Michal Hocko , Hugh Dickins , David Rientjes , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [patch 04/11] mm: memcg: push down PageSwapCache check into uncharge entry functions Message-ID: <20120709073614.GB1779@cmpxchg.org> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-5-git-send-email-hannes@cmpxchg.org> <4FFA4504.4040408@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FFA4504.4040408@jp.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2012 at 11:42:12AM +0900, Kamezawa Hiroyuki wrote: > (2012/07/05 9:44), Johannes Weiner wrote: > > @@ -3278,10 +3283,11 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg, > > unused = oldpage; > > } > > anon = PageAnon(used); > > - __mem_cgroup_uncharge_common(unused, > > - anon ? MEM_CGROUP_CHARGE_TYPE_ANON > > - : MEM_CGROUP_CHARGE_TYPE_CACHE, > > - true); > > + if (!PageSwapCache(page)) > > + __mem_cgroup_uncharge_common(unused, > > + anon ? MEM_CGROUP_CHARGE_TYPE_ANON > > + : MEM_CGROUP_CHARGE_TYPE_CACHE, > > + true); > > !PageSwapCache(unused) ? Argh, right. > But I think unused page's PG_swapcache is always dropped. So, the check is > not necessary. Oh, this is intentional: the check was in __mem_cgroup_uncharge_common before, which means it applied to this entry point as well. This is supposed to be a mechanical change that does not change any logic. The check is then removed in the next patch. --- Subject: mm: memcg: push down PageSwapCache check into uncharge entry functions fix Signed-off-by: Johannes Weiner --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a3bf414..f4ff18a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3283,7 +3283,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg, unused = oldpage; } anon = PageAnon(used); - if (!PageSwapCache(page)) + if (!PageSwapCache(unused)) __mem_cgroup_uncharge_common(unused, anon ? MEM_CGROUP_CHARGE_TYPE_ANON : MEM_CGROUP_CHARGE_TYPE_CACHE, From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx149.postini.com [74.125.245.149]) by kanga.kvack.org (Postfix) with SMTP id 54F556B006C for ; Mon, 9 Jul 2012 03:36:28 -0400 (EDT) Date: Mon, 9 Jul 2012 09:36:14 +0200 From: Johannes Weiner Subject: Re: [patch 04/11] mm: memcg: push down PageSwapCache check into uncharge entry functions Message-ID: <20120709073614.GB1779@cmpxchg.org> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-5-git-send-email-hannes@cmpxchg.org> <4FFA4504.4040408@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FFA4504.4040408@jp.fujitsu.com> Sender: owner-linux-mm@kvack.org List-ID: To: Kamezawa Hiroyuki Cc: Andrew Morton , Michal Hocko , Hugh Dickins , David Rientjes , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org On Mon, Jul 09, 2012 at 11:42:12AM +0900, Kamezawa Hiroyuki wrote: > (2012/07/05 9:44), Johannes Weiner wrote: > > @@ -3278,10 +3283,11 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg, > > unused = oldpage; > > } > > anon = PageAnon(used); > > - __mem_cgroup_uncharge_common(unused, > > - anon ? MEM_CGROUP_CHARGE_TYPE_ANON > > - : MEM_CGROUP_CHARGE_TYPE_CACHE, > > - true); > > + if (!PageSwapCache(page)) > > + __mem_cgroup_uncharge_common(unused, > > + anon ? MEM_CGROUP_CHARGE_TYPE_ANON > > + : MEM_CGROUP_CHARGE_TYPE_CACHE, > > + true); > > !PageSwapCache(unused) ? Argh, right. > But I think unused page's PG_swapcache is always dropped. So, the check is > not necessary. Oh, this is intentional: the check was in __mem_cgroup_uncharge_common before, which means it applied to this entry point as well. This is supposed to be a mechanical change that does not change any logic. The check is then removed in the next patch. --- Subject: mm: memcg: push down PageSwapCache check into uncharge entry functions fix Signed-off-by: Johannes Weiner --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a3bf414..f4ff18a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3283,7 +3283,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg, unused = oldpage; } anon = PageAnon(used); - if (!PageSwapCache(page)) + if (!PageSwapCache(unused)) __mem_cgroup_uncharge_common(unused, anon ? MEM_CGROUP_CHARGE_TYPE_ANON : MEM_CGROUP_CHARGE_TYPE_CACHE, -- 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: Johannes Weiner Subject: Re: [patch 04/11] mm: memcg: push down PageSwapCache check into uncharge entry functions Date: Mon, 9 Jul 2012 09:36:14 +0200 Message-ID: <20120709073614.GB1779@cmpxchg.org> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-5-git-send-email-hannes@cmpxchg.org> <4FFA4504.4040408@jp.fujitsu.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <4FFA4504.4040408-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Kamezawa Hiroyuki Cc: Andrew Morton , Michal Hocko , Hugh Dickins , David Rientjes , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Mon, Jul 09, 2012 at 11:42:12AM +0900, Kamezawa Hiroyuki wrote: > (2012/07/05 9:44), Johannes Weiner wrote: > > @@ -3278,10 +3283,11 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg, > > unused = oldpage; > > } > > anon = PageAnon(used); > > - __mem_cgroup_uncharge_common(unused, > > - anon ? MEM_CGROUP_CHARGE_TYPE_ANON > > - : MEM_CGROUP_CHARGE_TYPE_CACHE, > > - true); > > + if (!PageSwapCache(page)) > > + __mem_cgroup_uncharge_common(unused, > > + anon ? MEM_CGROUP_CHARGE_TYPE_ANON > > + : MEM_CGROUP_CHARGE_TYPE_CACHE, > > + true); > > !PageSwapCache(unused) ? Argh, right. > But I think unused page's PG_swapcache is always dropped. So, the check is > not necessary. Oh, this is intentional: the check was in __mem_cgroup_uncharge_common before, which means it applied to this entry point as well. This is supposed to be a mechanical change that does not change any logic. The check is then removed in the next patch. --- Subject: mm: memcg: push down PageSwapCache check into uncharge entry functions fix Signed-off-by: Johannes Weiner --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a3bf414..f4ff18a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3283,7 +3283,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *memcg, unused = oldpage; } anon = PageAnon(used); - if (!PageSwapCache(page)) + if (!PageSwapCache(unused)) __mem_cgroup_uncharge_common(unused, anon ? MEM_CGROUP_CHARGE_TYPE_ANON : MEM_CGROUP_CHARGE_TYPE_CACHE,