blob: 3bdcab30ca4121e5067cb2eac291d039c6eee07e [file] [log] [blame]
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -07001#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 Nazarewiczc80cd922012-04-03 15:06:15 +02006 * If specified range includes migrate types other than MOVABLE or CMA,
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -07007 * 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 */
13extern int
Michal Nazarewiczc80cd922012-04-03 15:06:15 +020014start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
15 unsigned migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070016
17/*
18 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
19 * target range is [start_pfn, end_pfn)
20 */
21extern int
Michal Nazarewiczc80cd922012-04-03 15:06:15 +020022undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
23 unsigned migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070024
25/*
Michal Nazarewiczc80cd922012-04-03 15:06:15 +020026 * Test all pages in [start_pfn, end_pfn) are isolated or not.
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070027 */
Michal Nazarewiczc80cd922012-04-03 15:06:15 +020028int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070029
30/*
Michal Nazarewiczc80cd922012-04-03 15:06:15 +020031 * Internal functions. Changes pageblock's migrate type.
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070032 */
33extern int set_migratetype_isolate(struct page *page);
Michal Nazarewiczc80cd922012-04-03 15:06:15 +020034extern void unset_migratetype_isolate(struct page *page, unsigned migratetype);
KAMEZAWA Hiroyukia5d76b52007-10-16 01:26:11 -070035
36
37#endif