Skip to content

Commit

Permalink
mm: Add is_migrate_cma_page
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
labbott authored and kees committed Jul 26, 2016
1 parent 523d939 commit 7c15d9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 7c15d9b

Please sign in to comment.