summaryrefslogtreecommitdiffstats
path: root/mm/khugepaged.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2020-06-04 01:02:40 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-04 05:09:48 +0200
commit6058eaec816f29fbe33c9d35694614c9a4ed75ba (patch)
tree88f63c509153486c4b71d6df45040ce658508dbc /mm/khugepaged.c
parentmm: allow swappiness that prefers reclaiming anon over the file workingset (diff)
downloadlinux-6058eaec816f29fbe33c9d35694614c9a4ed75ba.tar.xz
linux-6058eaec816f29fbe33c9d35694614c9a4ed75ba.zip
mm: fold and remove lru_cache_add_anon() and lru_cache_add_file()
They're the same function, and for the purpose of all callers they are equivalent to lru_cache_add(). [akpm@linux-foundation.org: fix it for local_lock changes] Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Rik van Riel <riel@surriel.com> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Link: http://lkml.kernel.org/r/20200520232525.798933-5-hannes@cmpxchg.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/khugepaged.c')
-rw-r--r--mm/khugepaged.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index f29038c485e0..3f032487825b 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1879,13 +1879,9 @@ xa_unlocked:
SetPageUptodate(new_page);
page_ref_add(new_page, HPAGE_PMD_NR - 1);
-
- if (is_shmem) {
+ if (is_shmem)
set_page_dirty(new_page);
- lru_cache_add_anon(new_page);
- } else {
- lru_cache_add_file(new_page);
- }
+ lru_cache_add(new_page);
/*
* Remove pte page tables, so we can re-fault the page as huge.