diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mmzone.h | 3 | ||||
-rw-r--r-- | include/linux/page-isolation.h | 37 | ||||
-rw-r--r-- | include/linux/pageblock-flags.h | 2 |
3 files changed, 40 insertions, 2 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 20ea42c45e4..f4bfe824834 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -37,7 +37,8 @@ #define MIGRATE_RECLAIMABLE 1 #define MIGRATE_MOVABLE 2 #define MIGRATE_RESERVE 3 -#define MIGRATE_TYPES 4 +#define MIGRATE_ISOLATE 4 /* can't allocate from here */ +#define MIGRATE_TYPES 5 #define for_each_migratetype_order(order, type) \ for (order = 0; order < MAX_ORDER; order++) \ diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h new file mode 100644 index 00000000000..051c1b1ede4 --- /dev/null +++ b/include/linux/page-isolation.h @@ -0,0 +1,37 @@ +#ifndef __LINUX_PAGEISOLATION_H +#define __LINUX_PAGEISOLATION_H + +/* + * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. + * If specified range includes migrate types other than MOVABLE, + * this will fail with -EBUSY. + * + * For isolating all pages in the range finally, the caller have to + * free all pages in the range. test_page_isolated() can be used for + * test it. + */ +extern int +start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); + +/* + * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. + * target range is [start_pfn, end_pfn) + */ +extern int +undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); + +/* + * test all pages in [start_pfn, end_pfn)are isolated or not. + */ +extern int +test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); + +/* + * Internal funcs.Changes pageblock's migrate type. + * Please use make_pagetype_isolated()/make_pagetype_movable(). + */ +extern int set_migratetype_isolate(struct page *page); +extern void unset_migratetype_isolate(struct page *page); + + +#endif diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index 9ea130829fb..e875905f7b1 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h @@ -31,7 +31,7 @@ /* Bit indices that affect a whole block of pages */ enum pageblock_bits { - PB_range(PB_migrate, 2), /* 2 bits required for migrate types */ + PB_range(PB_migrate, 3), /* 3 bits required for migrate types */ NR_PAGEBLOCK_BITS }; |