Thread (21 messages) 21 messages, 3 authors, 2016-07-26

[PATCH v4 01/12] mm: Add is_migrate_cma_page

From: Kees Cook <hidden>
Date: 2016-07-20 20:27:24
Also in: linux-arch, linux-arm-kernel, linux-mm, lkml, sparclinux
Subsystem: memory management - core, memory management - mglru (multi-gen lru), the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

From: Laura Abbott <redacted>

Code such as hardened user copy[1] needs a way to tell if a
page is CMA or not. Add is_migrate_cma_page in a similar way
to is_migrate_isolate_page.

[1]http://article.gmane.org/gmane.linux.kernel.mm/155238

Signed-off-by: Laura Abbott <redacted>
Signed-off-by: Kees Cook <redacted>
---
 include/linux/mmzone.h | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 02069c23486d..c8478b29f070 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -68,8 +68,10 @@ extern char * const migratetype_names[MIGRATE_TYPES];
 
 #ifdef CONFIG_CMA
 #  define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
+#  define is_migrate_cma_page(_page) (get_pageblock_migratetype(_page) == MIGRATE_CMA)
 #else
 #  define is_migrate_cma(migratetype) false
+#  define is_migrate_cma_page(_page) false
 #endif
 
 #define for_each_migratetype_order(order, type) \
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help