From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 2 Jul 2008 21:08:58 +0900 From: KAMEZAWA Hiroyuki Subject: [RFC][-mm] [2/7] delete FLAG_CACHE Message-Id: <20080702210858.ecea377f.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20080702210322.518f6c43.kamezawa.hiroyu@jp.fujitsu.com> References: <20080702210322.518f6c43.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: KAMEZAWA Hiroyuki Cc: "linux-mm@kvack.org" , "balbir@linux.vnet.ibm.com" , "xemul@openvz.org" , "nishimura@mxp.nes.nec.co.jp" , "yamamoto@valinux.co.jp" , "hugh@veritas.com" , "kosaki.motohiro@jp.fujitsu.com" List-ID: split-lru defines PAGE_CGROUP_FLAG_FILE...and memcg uses PAGE_CGROUP_FLAG_CACHE. It seems there are no major difference between 2 flags. This patch takes FLAG_FILE and delete FLAG_CACHE. Signed-off-by: KAMEZAWA Hiroyuki Index: test-2.6.26-rc5-mm3++/mm/memcontrol.c =================================================================== --- test-2.6.26-rc5-mm3++.orig/mm/memcontrol.c +++ test-2.6.26-rc5-mm3++/mm/memcontrol.c @@ -160,10 +160,9 @@ struct page_cgroup { struct mem_cgroup *mem_cgroup; int flags; }; -#define PAGE_CGROUP_FLAG_CACHE (0x1) /* charged as cache */ +#define PAGE_CGROUP_FLAG_FILE (0x1) /* charged as cache */ #define PAGE_CGROUP_FLAG_ACTIVE (0x2) /* page is active in this cgroup */ -#define PAGE_CGROUP_FLAG_FILE (0x4) /* page is file system backed */ -#define PAGE_CGROUP_FLAG_UNEVICTABLE (0x8) /* page is unevictableable */ +#define PAGE_CGROUP_FLAG_UNEVICTABLE (0x4) /* page is unevictableable */ static int page_cgroup_nid(struct page_cgroup *pc) { @@ -191,7 +190,7 @@ static void mem_cgroup_charge_statistics struct mem_cgroup_stat *stat = &mem->stat; VM_BUG_ON(!irqs_disabled()); - if (flags & PAGE_CGROUP_FLAG_CACHE) + if (flags & PAGE_CGROUP_FLAG_FILE) __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_CACHE, val); else __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_RSS, val); @@ -573,11 +572,9 @@ static int mem_cgroup_charge_common(stru * If a page is accounted as a page cache, insert to inactive list. * If anon, insert to active list. */ - if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) { - pc->flags = PAGE_CGROUP_FLAG_CACHE; - if (page_is_file_cache(page)) - pc->flags |= PAGE_CGROUP_FLAG_FILE; - } else + if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) + pc->flags = PAGE_CGROUP_FLAG_FILE; + else pc->flags = PAGE_CGROUP_FLAG_ACTIVE; lock_page_cgroup(page); @@ -772,7 +769,7 @@ int mem_cgroup_prepare_migration(struct if (pc) { mem = pc->mem_cgroup; css_get(&mem->css); - if (pc->flags & PAGE_CGROUP_FLAG_CACHE) + if (pc->flags & PAGE_CGROUP_FLAG_FILE) ctype = MEM_CGROUP_CHARGE_TYPE_CACHE; } unlock_page_cgroup(page); -- 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