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 20ea42c45e4a..f4bfe824834f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -37,7 +37,8 @@ | |||
37 | #define MIGRATE_RECLAIMABLE 1 | 37 | #define MIGRATE_RECLAIMABLE 1 |
38 | #define MIGRATE_MOVABLE 2 | 38 | #define MIGRATE_MOVABLE 2 |
39 | #define MIGRATE_RESERVE 3 | 39 | #define MIGRATE_RESERVE 3 |
40 | #define MIGRATE_TYPES 4 | 40 | #define MIGRATE_ISOLATE 4 /* can't allocate from here */ |
41 | #define MIGRATE_TYPES 5 | ||
41 | 42 | ||
42 | #define for_each_migratetype_order(order, type) \ | 43 | #define for_each_migratetype_order(order, type) \ |
43 | for (order = 0; order < MAX_ORDER; order++) \ | 44 | 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 000000000000..051c1b1ede4e --- /dev/null +++ b/include/linux/page-isolation.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef __LINUX_PAGEISOLATION_H | ||
2 | #define __LINUX_PAGEISOLATION_H | ||
3 | |||
4 | /* | ||
5 | * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. | ||
6 | * If specified range includes migrate types other than MOVABLE, | ||
7 | * this will fail with -EBUSY. | ||
8 | * | ||
9 | * For isolating all pages in the range finally, the caller have to | ||
10 | * free all pages in the range. test_page_isolated() can be used for | ||
11 | * test it. | ||
12 | */ | ||
13 | extern int | ||
14 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); | ||
15 | |||
16 | /* | ||
17 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. | ||
18 | * target range is [start_pfn, end_pfn) | ||
19 | */ | ||
20 | extern int | ||
21 | undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); | ||
22 | |||
23 | /* | ||
24 | * test all pages in [start_pfn, end_pfn)are isolated or not. | ||
25 | */ | ||
26 | extern int | ||
27 | test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); | ||
28 | |||
29 | /* | ||
30 | * Internal funcs.Changes pageblock's migrate type. | ||
31 | * Please use make_pagetype_isolated()/make_pagetype_movable(). | ||
32 | */ | ||
33 | extern int set_migratetype_isolate(struct page *page); | ||
34 | extern void unset_migratetype_isolate(struct page *page); | ||
35 | |||
36 | |||
37 | #endif | ||
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index 9ea130829fb4..e875905f7b12 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | /* Bit indices that affect a whole block of pages */ | 32 | /* Bit indices that affect a whole block of pages */ |
33 | enum pageblock_bits { | 33 | enum pageblock_bits { |
34 | PB_range(PB_migrate, 2), /* 2 bits required for migrate types */ | 34 | PB_range(PB_migrate, 3), /* 3 bits required for migrate types */ |
35 | NR_PAGEBLOCK_BITS | 35 | NR_PAGEBLOCK_BITS |
36 | }; | 36 | }; |
37 | 37 | ||