Skip to content

Commit 62ba744

Browse files
hnaztorvalds
authored andcommitted
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>
1 parent 827a03d commit 62ba744

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

mm/memcontrol.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ static bool move_file(void)
379379
enum charge_type {
380380
MEM_CGROUP_CHARGE_TYPE_CACHE = 0,
381381
MEM_CGROUP_CHARGE_TYPE_ANON,
382-
MEM_CGROUP_CHARGE_TYPE_SHMEM, /* used by page migration of shmem */
383382
MEM_CGROUP_CHARGE_TYPE_SWAPOUT, /* for accounting swapcache */
384383
MEM_CGROUP_CHARGE_TYPE_DROP, /* a page was unused swap cache */
385384
NR_CHARGE_TYPE,
@@ -2902,8 +2901,6 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
29022901

29032902
if (unlikely(!mm))
29042903
mm = &init_mm;
2905-
if (!page_is_file_cache(page))
2906-
type = MEM_CGROUP_CHARGE_TYPE_SHMEM;
29072904

29082905
if (!PageSwapCache(page))
29092906
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,
33103307
*/
33113308
if (PageAnon(page))
33123309
ctype = MEM_CGROUP_CHARGE_TYPE_ANON;
3313-
else if (page_is_file_cache(page))
3314-
ctype = MEM_CGROUP_CHARGE_TYPE_CACHE;
33153310
else
3316-
ctype = MEM_CGROUP_CHARGE_TYPE_SHMEM;
3311+
ctype = MEM_CGROUP_CHARGE_TYPE_CACHE;
33173312
/*
33183313
* The page is committed to the memcg, but it's not actually
33193314
* charged to the res_counter since we plan on replacing the
@@ -3407,10 +3402,6 @@ void mem_cgroup_replace_page_cache(struct page *oldpage,
34073402
*/
34083403
if (!memcg)
34093404
return;
3410-
3411-
if (PageSwapBacked(oldpage))
3412-
type = MEM_CGROUP_CHARGE_TYPE_SHMEM;
3413-
34143405
/*
34153406
* Even if newpage->mapping was NULL before starting replacement,
34163407
* the newpage may be on LRU(or pagevec for LRU) already. We lock

0 commit comments

Comments
 (0)