Thread (15 messages) 15 messages, 4 authors, 2021-05-29
STALE1849d

[RFC PATCH 3/5] include/linux/mm.h: helper to check zone device generic type

From: Felix Kuehling <hidden>
Date: 2021-05-27 23:10:30
Also in: amd-gfx, dri-devel
Subsystem: memory management - core, the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

From: Alex Sierra <redacted>

Helper to check if zone device page is generic type.

Signed-off-by: Alex Sierra <redacted>
---
 include/linux/mm.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c9900aedc195..1af7b9b76948 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1158,6 +1158,13 @@ static inline bool is_device_private_page(const struct page *page)
 		page->pgmap->type == MEMORY_DEVICE_PRIVATE;
 }
 
+static inline bool is_device_generic_page(const struct page *page)
+{
+	return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) &&
+		is_zone_device_page(page) &&
+		page->pgmap->type == MEMORY_DEVICE_GENERIC;
+}
+
 static inline bool is_pci_p2pdma_page(const struct page *page)
 {
 	return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) &&
-- 
2.31.1

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