[PATCH v3 19/25] memcontrol-v1: Ignore ZONE_DEVICE pages

Alistair Popple
2024-11-22T01:42:50Z

memcontrol currently ignores device dax and fs dax pages because these
pages are considered special. To maintain existing behaviour once
these pages are treated as normal pages and returned from
vm_normal_page() add a test to explicitly skip charging them.

Signed-off-by: Alistair Popple <apopple@nvidia.com>
---
mm/memcontrol-v1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c
index 81d8819..b10a095 100644
--- a/mm/memcontrol-v1.c
+++ b/mm/memcontrol-v1.c
@@ -667,7 +667,7 @@ static struct page *mc_handle_present_pte(struct vm_area_struct *vma,
{
struct page *page = vm_normal_page(vma, addr, ptent);

- if (!page)
+ if (!page || is_device_dax_page(page) || is_fsdax_page(page))
return NULL;
if (PageAnon(page)) {
if (!(mc.flags & MOVE_ANON))
--
git-series 0.9.1