blob: 105077aa7685c61dbb66cabc8473302283a0e3a5 [file] [log] [blame]
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -07001#ifndef __LINUX_PAGEISOLATION_H
2#define __LINUX_PAGEISOLATION_H
3
Minchan Kimee6f5092012-07-31 16:43:50 -07004
5bool has_unmovable_pages(struct zone *zone, struct page *page, int count);
6void set_pageblock_migratetype(struct page *page, int migratetype);
7int move_freepages_block(struct zone *zone, struct page *page,
8 int migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -07009/*
10 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE.
Michal Nazarewicz0815f3d2012-04-03 15:06:15 +020011 * If specified range includes migrate types other than MOVABLE or CMA,
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070012 * this will fail with -EBUSY.
13 *
14 * For isolating all pages in the range finally, the caller have to
15 * free all pages in the range. test_page_isolated() can be used for
16 * test it.
17 */
Minchan Kimee6f5092012-07-31 16:43:50 -070018int
Michal Nazarewicz0815f3d2012-04-03 15:06:15 +020019start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
20 unsigned migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070021
22/*
23 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
24 * target range is [start_pfn, end_pfn)
25 */
Minchan Kimee6f5092012-07-31 16:43:50 -070026int
Michal Nazarewicz0815f3d2012-04-03 15:06:15 +020027undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
28 unsigned migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070029
30/*
Michal Nazarewicz0815f3d2012-04-03 15:06:15 +020031 * Test all pages in [start_pfn, end_pfn) are isolated or not.
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070032 */
Michal Nazarewicz0815f3d2012-04-03 15:06:15 +020033int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070034
35/*
Michal Nazarewicz0815f3d2012-04-03 15:06:15 +020036 * Internal functions. Changes pageblock's migrate type.
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070037 */
Minchan Kimee6f5092012-07-31 16:43:50 -070038int set_migratetype_isolate(struct page *page);
39void unset_migratetype_isolate(struct page *page, unsigned migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070040
41
42#endif