KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 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. |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 6 | * If specified range includes migrate types other than MOVABLE or CMA, |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 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 |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 14 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, |
| 15 | unsigned migratetype); |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 16 | |
| 17 | /* |
| 18 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. |
| 19 | * target range is [start_pfn, end_pfn) |
| 20 | */ |
| 21 | extern int |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 22 | undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, |
| 23 | unsigned migratetype); |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 24 | |
| 25 | /* |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 26 | * Test all pages in [start_pfn, end_pfn) are isolated or not. |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 27 | */ |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 28 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 29 | |
| 30 | /* |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 31 | * Internal functions. Changes pageblock's migrate type. |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 32 | */ |
| 33 | extern int set_migratetype_isolate(struct page *page); |
Michal Nazarewicz | 0815f3d | 2012-04-03 15:06:15 +0200 | [diff] [blame] | 34 | extern void unset_migratetype_isolate(struct page *page, unsigned migratetype); |
KAMEZAWA Hiroyuki | a5d76b5 | 2007-10-16 01:26:11 -0700 | [diff] [blame] | 35 | |
| 36 | |
| 37 | #endif |