From e42919d7ac0dbcab6a20237cf1d8987c0b9b6b11 Mon Sep 17 00:00:00 2001 From: KAMEZAWA Hiroyuki Date: Fri, 25 Jul 2008 01:47:09 -0700 Subject: [PATCH] --- yaml --- r: 105903 b: refs/heads/master c: 508b7be0a5b06b64203512ed9b34191cddc83f56 h: refs/heads/master i: 105901: 20c70a78925cb691be7b511b859c38e5b91418cf 105899: ed387ac13a5823d1a9128bd48d93477bd9d7541a 105895: 5ccf3cb7f03c0becb0f5ca2f31b751464e748dcc 105887: 784d34f8fe6d952679c2eefd150f2e7872ccc502 v: v3 --- [refs] | 2 +- trunk/mm/memcontrol.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 3ecd781c3c81..07262bcf3cc4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a181b0e888a1d917edcab57cd73ccf7d8e75a46c +refs/heads/master: 508b7be0a5b06b64203512ed9b34191cddc83f56 diff --git a/trunk/mm/memcontrol.c b/trunk/mm/memcontrol.c index c52c045f5152..90ccc1326356 100644 --- a/trunk/mm/memcontrol.c +++ b/trunk/mm/memcontrol.c @@ -296,7 +296,7 @@ static void __mem_cgroup_remove_list(struct mem_cgroup_per_zone *mz, MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_INACTIVE) -= 1; mem_cgroup_charge_statistics(pc->mem_cgroup, pc->flags, false); - list_del_init(&pc->lru); + list_del(&pc->lru); } static void __mem_cgroup_add_list(struct mem_cgroup_per_zone *mz, @@ -559,7 +559,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, } unlock_page_cgroup(page); - pc = kmem_cache_zalloc(page_cgroup_cache, gfp_mask); + pc = kmem_cache_alloc(page_cgroup_cache, gfp_mask); if (pc == NULL) goto err; @@ -606,9 +606,14 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, pc->ref_cnt = 1; pc->mem_cgroup = mem; pc->page = page; - pc->flags = PAGE_CGROUP_FLAG_ACTIVE; + /* + * 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; + else + pc->flags = PAGE_CGROUP_FLAG_ACTIVE; lock_page_cgroup(page); if (page_get_page_cgroup(page)) {