mm/migrate: Introduce migrate_misplaced_page()
Subsystems (2)
Commit-ID: 03a040f6c17ab81659579ba6abe267c0562097e4 Gitweb: http://git.kernel.org/tip/03a040f6c17ab81659579ba6abe267c0562097e4 Author: Peter Zijlstra <[email protected]> AuthorDate: Tue, 17 Jul 2012 22:54:51 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 26 Sep 2012 11:48:34 +0200
mm/migrate: Introduce migrate_misplaced_page()
Add migrate_misplaced_page() which deals with migrating pages from faults. This includes adding a new MIGRATE_FAULT migration mode to deal with the extra page reference required due to having to look up the page.
Based-on-work-by Lee Schermerhorn <[email protected]>
Signed-off-by Peter Zijlstra <[email protected]>
Reviewed-by Rik van Riel <[email protected]>
Cc Paul Turner <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Andrew Morton <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- include/linux/migrate.h | 7 +++ include/linux/migrate_mode.h | 3 + mm/migrate.c | 85 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 87 insertions(+), 8 deletions(-)
include/linux/migrate.h +7 -0
@@ -30,6 +30,7 @@ extern int migrate_vmas(struct mm_struct *mm,extern void migrate_page_copy (struct page *newpage,struct page *page);extern int migrate_huge_page_move_mapping (struct address_space *mapping,struct page *newpage,struct page *page); +extern int migrate_misplaced_page (struct mm_struct *,struct page *,int );#else static inline void putback_lru_pages (struct list_head *l) {}
@@ -63,5 +64,11 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping,#define migrate_page NULL#define fail_migrate_page NULL +static inline +int migrate_misplaced_page (struct mm_struct *mm,struct page *page,int node) +{ +return -EAGAIN ;/* can't migrate now */ +}#endif /* CONFIG_MIGRATION */ +#endif /* _LINUX_MIGRATE_H */
include/linux/migrate_mode.h +3 -0
@@ -6,11 +6,14 @@* on most operations but not ->writepage as the potential stall time * is too significant * MIGRATE_SYNC will block when migrating pages +* MIGRATE_FAULT called from the fault path to migrate-on-fault for mempolicy +* this path has an extra reference count */ enum migrate_mode {MIGRATE_ASYNC ,MIGRATE_SYNC_LIGHT ,MIGRATE_SYNC , +MIGRATE_FAULT , };#endif /* MIGRATE_MODE_H_INCLUDED */
mm/migrate.c +77 -8
128 lines not on this page · raw message