diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2007-10-16 04:26:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:02 -0400 |
commit | a5d76b54a3f3a40385d7f76069a2feac9f1bad63 (patch) | |
tree | f58c432a4224b3be032bd4a4afa79dfa55d198a6 /include/linux/page-isolation.h | |
parent | 75884fb1c6388f3713ddcca662f3647b3129aaeb (diff) |
memory unplug: page isolation
Implement generic chunk-of-pages isolation method by using page grouping ops.
This patch add MIGRATE_ISOLATE to MIGRATE_TYPES. By this
- MIGRATE_TYPES increases.
- bitmap for migratetype is enlarged.
pages of MIGRATE_ISOLATE migratetype will not be allocated even if it is free.
By this, you can isolated *freed* pages from users. How-to-free pages is not
a purpose of this patch. You may use reclaim and migrate codes to free pages.
If start_isolate_page_range(start,end) is called,
- migratetype of the range turns to be MIGRATE_ISOLATE if
its type is MIGRATE_MOVABLE. (*) this check can be updated if other
memory reclaiming works make progress.
- MIGRATE_ISOLATE is not on migratetype fallback list.
- All free pages and will-be-freed pages are isolated.
To check all pages in the range are isolated or not, use test_pages_isolated(),
To cancel isolation, use undo_isolate_page_range().
Changes V6 -> V7
- removed unnecessary #ifdef
There are HOLES_IN_ZONE handling codes...I'm glad if we can remove them..
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/page-isolation.h')
-rw-r--r-- | include/linux/page-isolation.h | 37 |
1 files changed, 37 insertions, 0 deletions
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 | ||