[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210729125755.16871-6-linmiaohe@huawei.com>
Date: Thu, 29 Jul 2021 20:57:55 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <hannes@...xchg.org>, <mhocko@...nel.org>,
<vdavydov.dev@...il.com>, <akpm@...ux-foundation.org>
CC: <shakeelb@...gle.com>, <guro@...com>, <willy@...radead.org>,
<alexs@...nel.org>, <richard.weiyang@...il.com>,
<songmuchun@...edance.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <cgroups@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH 5/5] mm, memcg: always call __mod_node_page_state() with preempt disabled
We should always ensure __mod_node_page_state() is called with preempt
disabled or percpu ops may manipulate the wrong cpu when preempt happened.
Fixes: b4e0b68fbd9d ("mm: memcontrol: use obj_cgroup APIs to charge kmem pages")
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 70a32174e7c4..616d1a72ece3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -697,8 +697,8 @@ void __mod_lruvec_page_state(struct page *page, enum node_stat_item idx,
memcg = page_memcg(head);
/* Untracked pages have no memcg, no lruvec. Update only the node */
if (!memcg) {
- rcu_read_unlock();
__mod_node_page_state(pgdat, idx, val);
+ rcu_read_unlock();
return;
}
--
2.23.0
Powered by blists - more mailing lists