diff options
-rw-r--r-- | mm/memcontrol.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3be1afab8523..17a79e5ed688 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -379,7 +379,6 @@ static bool move_file(void) | |||
379 | enum charge_type { | 379 | enum charge_type { |
380 | MEM_CGROUP_CHARGE_TYPE_CACHE = 0, | 380 | MEM_CGROUP_CHARGE_TYPE_CACHE = 0, |
381 | MEM_CGROUP_CHARGE_TYPE_ANON, | 381 | MEM_CGROUP_CHARGE_TYPE_ANON, |
382 | MEM_CGROUP_CHARGE_TYPE_SHMEM, /* used by page migration of shmem */ | ||
383 | MEM_CGROUP_CHARGE_TYPE_SWAPOUT, /* for accounting swapcache */ | 382 | MEM_CGROUP_CHARGE_TYPE_SWAPOUT, /* for accounting swapcache */ |
384 | MEM_CGROUP_CHARGE_TYPE_DROP, /* a page was unused swap cache */ | 383 | MEM_CGROUP_CHARGE_TYPE_DROP, /* a page was unused swap cache */ |
385 | NR_CHARGE_TYPE, | 384 | NR_CHARGE_TYPE, |
@@ -2902,8 +2901,6 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | |||
2902 | 2901 | ||
2903 | if (unlikely(!mm)) | 2902 | if (unlikely(!mm)) |
2904 | mm = &init_mm; | 2903 | mm = &init_mm; |
2905 | if (!page_is_file_cache(page)) | ||
2906 | type = MEM_CGROUP_CHARGE_TYPE_SHMEM; | ||
2907 | 2904 | ||
2908 | if (!PageSwapCache(page)) | 2905 | if (!PageSwapCache(page)) |
2909 | ret = mem_cgroup_charge_common(page, mm, gfp_mask, type); | 2906 | ret = mem_cgroup_charge_common(page, mm, gfp_mask, type); |
@@ -3310,10 +3307,8 @@ void mem_cgroup_prepare_migration(struct page *page, struct page *newpage, | |||
3310 | */ | 3307 | */ |
3311 | if (PageAnon(page)) | 3308 | if (PageAnon(page)) |
3312 | ctype = MEM_CGROUP_CHARGE_TYPE_ANON; | 3309 | ctype = MEM_CGROUP_CHARGE_TYPE_ANON; |
3313 | else if (page_is_file_cache(page)) | ||
3314 | ctype = MEM_CGROUP_CHARGE_TYPE_CACHE; | ||
3315 | else | 3310 | else |
3316 | ctype = MEM_CGROUP_CHARGE_TYPE_SHMEM; | 3311 | ctype = MEM_CGROUP_CHARGE_TYPE_CACHE; |
3317 | /* | 3312 | /* |
3318 | * The page is committed to the memcg, but it's not actually | 3313 | * The page is committed to the memcg, but it's not actually |
3319 | * charged to the res_counter since we plan on replacing the | 3314 | * charged to the res_counter since we plan on replacing the |
@@ -3407,10 +3402,6 @@ void mem_cgroup_replace_page_cache(struct page *oldpage, | |||
3407 | */ | 3402 | */ |
3408 | if (!memcg) | 3403 | if (!memcg) |
3409 | return; | 3404 | return; |
3410 | |||
3411 | if (PageSwapBacked(oldpage)) | ||
3412 | type = MEM_CGROUP_CHARGE_TYPE_SHMEM; | ||
3413 | |||
3414 | /* | 3405 | /* |
3415 | * Even if newpage->mapping was NULL before starting replacement, | 3406 | * Even if newpage->mapping was NULL before starting replacement, |
3416 | * the newpage may be on LRU(or pagevec for LRU) already. We lock | 3407 | * the newpage may be on LRU(or pagevec for LRU) already. We lock |