diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2012-07-31 19:45:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 21:42:48 -0400 |
commit | 62ba7442c8e286b6dd68fe82a3cc85c9414d909b (patch) | |
tree | c46f57d2607562ce6682b780a7085ea2f32ef79f /mm | |
parent | 827a03d22e776ff7838b5b2780b71092e0b9de1e (diff) |
mm: memcg: remove unneeded shmem charge type
shmem page charges have not needed a separate charge type to tell them
from regular file pages since 08e552c ("memcg: synchronized LRU").
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Wanpeng Li <liwp.linux@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-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 |