From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.18.234]) by e23smtp03.au.ibm.com (8.13.1/8.13.1) with ESMTP id m655eGEG031495 for ; Sat, 5 Jul 2008 15:40:16 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m655el8I979140 for ; Sat, 5 Jul 2008 15:40:48 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m655fDOM004011 for ; Sat, 5 Jul 2008 15:41:14 +1000 Message-ID: <486F0976.7010104@linux.vnet.ibm.com> Date: Sat, 05 Jul 2008 11:11:10 +0530 From: Balbir Singh Reply-To: balbir@linux.vnet.ibm.com MIME-Version: 1.0 Subject: Re: [PATCH] memcg: handle shmem's swap cache (Was 2.6.26-rc8-mm1 References: <20080703020236.adaa51fa.akpm@linux-foundation.org> <20080704180913.bb1a3fc6.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20080704180913.bb1a3fc6.kamezawa.hiroyu@jp.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: KAMEZAWA Hiroyuki Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "hugh@veritas.com" , "nishimura@mxp.nes.nec.co.jp" , "yamamoto@valinux.co.jp" List-ID: KAMEZAWA Hiroyuki wrote: > My swapcache accounting under memcg patch failed to catch tmpfs(shmem)'s one. > Can I test this under -mm tree ? > (If -mm is busy, I'm not in hurry.) > This patch works well in my box. > = > SwapCache handling fix. > > shmem's swapcache behavior is a little different from anonymous's one and > memcg failed to handle it. This patch tries to fix it. > > After this: > > Any page marked as SwapCache is not uncharged. (delelte_from_swap_cache() > delete the SwapCache flag.) > > To check a shmem-page-cache is alive or not we use > page->mapping && !PageAnon(page) instead of > pc->flags & PAGE_CGROUP_FLAG_CACHE. > > Signed-off-by: KAMEZAWA Hiroyuki Though I am not opposed to this, I do sit up and think if keeping the reference count around could avoid this complexity and from my point, the maintenance overhead of this logic/code (I fear there might be more special cases :( ) The trade-off is complexity versus the overhead of reference counting. -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL -- 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