[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191210134911.2570-1-pilgrimtao@gmail.com>
Date: Tue, 10 Dec 2019 05:49:10 -0800
From: chengkaitao <pilgrimtao@...il.com>
To: hannes@...xchg.org
Cc: mhocko@...nel.org, vdavydov.dev@...il.com,
akpm@...ux-foundation.org, cgroups@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
smuchun@...il.com, Kaitao Cheng <pilgrimtao@...il.com>
Subject: [PATCH] mm: cleanup some useless code
From: Kaitao Cheng <pilgrimtao@...il.com>
There is a duplicate PageTransHuge, because hpage_nr_pages have
the same one.
Signed-off-by: Kaitao Cheng <pilgrimtao@...il.com>
---
mm/memcontrol.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index bc01423277c5..870284d3ee9d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6678,7 +6678,6 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage)
{
struct mem_cgroup *memcg;
unsigned int nr_pages;
- bool compound;
unsigned long flags;
VM_BUG_ON_PAGE(!PageLocked(oldpage), oldpage);
@@ -6700,8 +6699,7 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage)
return;
/* Force-charge the new page. The old one will be freed soon */
- compound = PageTransHuge(newpage);
- nr_pages = compound ? hpage_nr_pages(newpage) : 1;
+ nr_pages = hpage_nr_pages(newpage);
page_counter_charge(&memcg->memory, nr_pages);
if (do_memsw_account())
@@ -6711,7 +6709,8 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage)
commit_charge(newpage, memcg, false);
local_irq_save(flags);
- mem_cgroup_charge_statistics(memcg, newpage, compound, nr_pages);
+ mem_cgroup_charge_statistics(memcg, newpage, PageTransHuge(newpage),
+ nr_pages);
memcg_check_events(memcg, newpage);
local_irq_restore(flags);
}
--
2.20.1
Powered by blists - more mailing lists