diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2010-09-07 21:19:35 -0400 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-10-08 03:32:45 -0400 |
commit | 290408d4a25002f099efeee7b6a5778d431154d6 (patch) | |
tree | c0a69a11ce963ef8a22607f5e782ae667ca5d538 /include/linux/migrate.h | |
parent | 0ebabb416f585ace711769057422af4bbc9d1110 (diff) |
hugetlb: hugepage migration core
This patch extends page migration code to support hugepage migration.
One of the potential users of this feature is soft offlining which
is triggered by memory corrected errors (added by the next patch.)
Todo:
- there are other users of page migration such as memory policy,
memory hotplug and memocy compaction.
They are not ready for hugepage support for now.
ChangeLog since v4:
- define migrate_huge_pages()
- remove changes on isolation/putback_lru_page()
ChangeLog since v2:
- refactor isolate/putback_lru_page() to handle hugepage
- add comment about race on unmap_and_move_huge_page()
ChangeLog since v1:
- divide migration code path for hugepage
- define routine checking migration swap entry for hugetlb
- replace "goto" with "if/else" in remove_migration_pte()
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'include/linux/migrate.h')
-rw-r--r-- | include/linux/migrate.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 7238231b8dd4..3c1941e40e61 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -14,6 +14,8 @@ extern int migrate_page(struct address_space *, | |||
14 | struct page *, struct page *); | 14 | struct page *, struct page *); |
15 | extern int migrate_pages(struct list_head *l, new_page_t x, | 15 | extern int migrate_pages(struct list_head *l, new_page_t x, |
16 | unsigned long private, int offlining); | 16 | unsigned long private, int offlining); |
17 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, | ||
18 | unsigned long private, int offlining); | ||
17 | 19 | ||
18 | extern int fail_migrate_page(struct address_space *, | 20 | extern int fail_migrate_page(struct address_space *, |
19 | struct page *, struct page *); | 21 | struct page *, struct page *); |
@@ -23,12 +25,17 @@ extern int migrate_prep_local(void); | |||
23 | extern int migrate_vmas(struct mm_struct *mm, | 25 | extern int migrate_vmas(struct mm_struct *mm, |
24 | const nodemask_t *from, const nodemask_t *to, | 26 | const nodemask_t *from, const nodemask_t *to, |
25 | unsigned long flags); | 27 | unsigned long flags); |
28 | extern void migrate_page_copy(struct page *newpage, struct page *page); | ||
29 | extern int migrate_huge_page_move_mapping(struct address_space *mapping, | ||
30 | struct page *newpage, struct page *page); | ||
26 | #else | 31 | #else |
27 | #define PAGE_MIGRATION 0 | 32 | #define PAGE_MIGRATION 0 |
28 | 33 | ||
29 | static inline void putback_lru_pages(struct list_head *l) {} | 34 | static inline void putback_lru_pages(struct list_head *l) {} |
30 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 35 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
31 | unsigned long private, int offlining) { return -ENOSYS; } | 36 | unsigned long private, int offlining) { return -ENOSYS; } |
37 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, | ||
38 | unsigned long private, int offlining) { return -ENOSYS; } | ||
32 | 39 | ||
33 | static inline int migrate_prep(void) { return -ENOSYS; } | 40 | static inline int migrate_prep(void) { return -ENOSYS; } |
34 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 41 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
@@ -40,6 +47,15 @@ static inline int migrate_vmas(struct mm_struct *mm, | |||
40 | return -ENOSYS; | 47 | return -ENOSYS; |
41 | } | 48 | } |
42 | 49 | ||
50 | static inline void migrate_page_copy(struct page *newpage, | ||
51 | struct page *page) {} | ||
52 | |||
53 | extern int migrate_huge_page_move_mapping(struct address_space *mapping, | ||
54 | struct page *newpage, struct page *page) | ||
55 | { | ||
56 | return -ENOSYS; | ||
57 | } | ||
58 | |||
43 | /* Possible settings for the migrate_page() method in address_operations */ | 59 | /* Possible settings for the migrate_page() method in address_operations */ |
44 | #define migrate_page NULL | 60 | #define migrate_page NULL |
45 | #define fail_migrate_page NULL | 61 | #define fail_migrate_page NULL |