Thread (59 messages) 59 messages, 8 authors, 2025-06-12

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

From: David Hildenbrand <hidden>
Date: 2025-05-30 09:42:55
Also in: dri-devel, linux-arm-kernel, linux-cxl, linux-ext4, linux-fsdevel, linux-mm, linux-riscv, linux-xfs, lkml, loongarch, nvdimm

On 29.05.25 08:32, Alistair Popple wrote:
Previously dax pages were skipped by the pagewalk code as pud_special() or
vm_normal_page{_pmd}() would be false for DAX pages. Now that dax pages are
refcounted normally that is no longer the case, so add explicit checks to
skip them.
Is this really what we want, though? If these are now just "normal" 
pages, they shall be handled as being normal.

I would assume that we want to check that in the callers instead.

E.g., in get_mergeable_page() we already have a folio_is_zone_device() 
check.
quoted hunk ↗ jump to hunk
Signed-off-by: Alistair Popple <apopple@nvidia.com>
---
  include/linux/memremap.h | 11 +++++++++++
  mm/pagewalk.c            | 12 ++++++++++--
  2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index 4aa1519..54e8b57 100644
--- a/include/linux/memremap.h
+++ b/include/linux/memremap.h
@@ -198,6 +198,17 @@ static inline bool folio_is_fsdax(const struct folio *folio)
  	return is_fsdax_page(&folio->page);
  }
  
+static inline bool is_devdax_page(const struct page *page)
+{
+	return is_zone_device_page(page) &&
+		page_pgmap(page)->type == MEMORY_DEVICE_GENERIC;
+}
+
+static inline bool folio_is_devdax(const struct folio *folio)
+{
+	return is_devdax_page(&folio->page);
+}
Hm, nobody uses folio_is_devdax() in this patch :)


-- 
Cheers,

David / dhildenb

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help