[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210318110658.60892-4-songmuchun@bytedance.com>
Date: Thu, 18 Mar 2021 19:06:56 +0800
From: Muchun Song <songmuchun@...edance.com>
To: guro@...com, hannes@...xchg.org, mhocko@...nel.org,
akpm@...ux-foundation.org, shakeelb@...gle.com,
vdavydov.dev@...il.com
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
duanxiongchun@...edance.com, Muchun Song <songmuchun@...edance.com>
Subject: [PATCH v4 3/5] 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 optimization.
Signed-off-by: Muchun Song <songmuchun@...edance.com>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index fc22da9805fb..104bddf21314 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6845,6 +6845,7 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug)
uncharge_gather_clear(ug);
}
ug->memcg = page_memcg(page);
+ ug->dummy_page = page;
/* pairs with css_put in uncharge_batch */
css_get(&ug->memcg->css);
@@ -6858,7 +6859,6 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug)
else
ug->pgpgout++;
- ug->dummy_page = page;
page->memcg_data = 0;
css_put(&ug->memcg->css);
}
--
2.11.0
Powered by blists - more mailing lists