diff mbox series

[071/178] mm: memcontrol: change ug->dummy_page only if memcg changed

Message ID 20210430055648.dvlfgXvVh%akpm@linux-foundation.org (mailing list archive)
State New
Headers show
Series [001/178] arch/ia64/kernel/head.S: remove duplicate include | expand

Commit Message

Andrew Morton April 30, 2021, 5:56 a.m. UTC
From: Muchun Song <songmuchun@bytedance.com>
Subject: mm: memcontrol: change ug->dummy_page only if memcg changed

Just like assignment to ug->memcg, we only need to update ug->dummy_page
if memcg changed.  So move it to there.  This is a very small

Link: https://lkml.kernel.org/r/20210319163821.20704-5-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

 mm/memcontrol.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


--- a/mm/memcontrol.c~mm-memcontrol-change-ug-dummy_page-only-if-memcg-changed
+++ a/mm/memcontrol.c
@@ -6843,6 +6843,7 @@  static void uncharge_page(struct page *p
 		ug->memcg = page_memcg(page);
+		ug->dummy_page = page;
 		/* pairs with css_put in uncharge_batch */
@@ -6856,7 +6857,6 @@  static void uncharge_page(struct page *p
-	ug->dummy_page = page;
 	page->memcg_data = 0;