diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c52c045f5152..90ccc1326356 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -296,7 +296,7 @@ static void __mem_cgroup_remove_list(struct mem_cgroup_per_zone *mz, | |||
296 | MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_INACTIVE) -= 1; | 296 | MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_INACTIVE) -= 1; |
297 | 297 | ||
298 | mem_cgroup_charge_statistics(pc->mem_cgroup, pc->flags, false); | 298 | mem_cgroup_charge_statistics(pc->mem_cgroup, pc->flags, false); |
299 | list_del_init(&pc->lru); | 299 | list_del(&pc->lru); |
300 | } | 300 | } |
301 | 301 | ||
302 | static void __mem_cgroup_add_list(struct mem_cgroup_per_zone *mz, | 302 | static void __mem_cgroup_add_list(struct mem_cgroup_per_zone *mz, |
@@ -559,7 +559,7 @@ retry: | |||
559 | } | 559 | } |
560 | unlock_page_cgroup(page); | 560 | unlock_page_cgroup(page); |
561 | 561 | ||
562 | pc = kmem_cache_zalloc(page_cgroup_cache, gfp_mask); | 562 | pc = kmem_cache_alloc(page_cgroup_cache, gfp_mask); |
563 | if (pc == NULL) | 563 | if (pc == NULL) |
564 | goto err; | 564 | goto err; |
565 | 565 | ||
@@ -606,9 +606,14 @@ retry: | |||
606 | pc->ref_cnt = 1; | 606 | pc->ref_cnt = 1; |
607 | pc->mem_cgroup = mem; | 607 | pc->mem_cgroup = mem; |
608 | pc->page = page; | 608 | pc->page = page; |
609 | pc->flags = PAGE_CGROUP_FLAG_ACTIVE; | 609 | /* |
610 | * If a page is accounted as a page cache, insert to inactive list. | ||
611 | * If anon, insert to active list. | ||
612 | */ | ||
610 | if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) | 613 | if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) |
611 | pc->flags = PAGE_CGROUP_FLAG_CACHE; | 614 | pc->flags = PAGE_CGROUP_FLAG_CACHE; |
615 | else | ||
616 | pc->flags = PAGE_CGROUP_FLAG_ACTIVE; | ||
612 | 617 | ||
613 | lock_page_cgroup(page); | 618 | lock_page_cgroup(page); |
614 | if (page_get_page_cgroup(page)) { | 619 | if (page_get_page_cgroup(page)) { |