[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240704043132.28501-43-osalvador@suse.de>
Date: Thu, 4 Jul 2024 06:31:29 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
Peter Xu <peterx@...hat.com>,
Muchun Song <muchun.song@...ux.dev>,
David Hildenbrand <david@...hat.com>,
SeongJae Park <sj@...nel.org>,
Miaohe Lin <linmiaohe@...wei.com>,
Michal Hocko <mhocko@...e.com>,
Matthew Wilcox <willy@...radead.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Oscar Salvador <osalvador@...e.de>
Subject: [PATCH 42/45] mm/memcontrol: Make mem_cgroup_move_test_walk skip hugetlb vmas
Skip hugetlb vmas as we are not interested in those.
Signed-off-by: Oscar Salvador <osalvador@...e.de>
---
mm/memcontrol-v1.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c
index 99cc9501eec1..542922562cf9 100644
--- a/mm/memcontrol-v1.c
+++ b/mm/memcontrol-v1.c
@@ -1319,8 +1319,20 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
return ret;
}
+static int mem_cgroup_move_test_walk(unsigned long start, unsigned long end,
+ struct mm_walk *walk)
+{
+ struct vm_area_struct *vma = walk->vma;
+
+ if (is_vm_hugetlb_page(vma))
+ return 1;
+
+ return 0;
+}
+
static const struct mm_walk_ops charge_walk_ops = {
.pmd_entry = mem_cgroup_move_charge_pte_range,
+ .test_walk = mem_cgroup_move_test_walk,
.walk_lock = PGWALK_RDLOCK,
};
--
2.26.2
Powered by blists - more mailing lists