diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/migrate.c | 3 | ||||
-rw-r--r-- | mm/page_owner.c | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 3ad0fea5c438..8133805431ba 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/balloon_compaction.h> | 38 | #include <linux/balloon_compaction.h> |
39 | #include <linux/mmu_notifier.h> | 39 | #include <linux/mmu_notifier.h> |
40 | #include <linux/page_idle.h> | 40 | #include <linux/page_idle.h> |
41 | #include <linux/page_owner.h> | ||
41 | 42 | ||
42 | #include <asm/tlbflush.h> | 43 | #include <asm/tlbflush.h> |
43 | 44 | ||
@@ -578,6 +579,8 @@ void migrate_page_copy(struct page *newpage, struct page *page) | |||
578 | */ | 579 | */ |
579 | if (PageWriteback(newpage)) | 580 | if (PageWriteback(newpage)) |
580 | end_page_writeback(newpage); | 581 | end_page_writeback(newpage); |
582 | |||
583 | copy_page_owner(page, newpage); | ||
581 | } | 584 | } |
582 | 585 | ||
583 | /************************************************************ | 586 | /************************************************************ |
diff --git a/mm/page_owner.c b/mm/page_owner.c index feaa28b40c1c..774b55623212 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c | |||
@@ -84,6 +84,31 @@ gfp_t __get_page_owner_gfp(struct page *page) | |||
84 | return page_ext->gfp_mask; | 84 | return page_ext->gfp_mask; |
85 | } | 85 | } |
86 | 86 | ||
87 | void __copy_page_owner(struct page *oldpage, struct page *newpage) | ||
88 | { | ||
89 | struct page_ext *old_ext = lookup_page_ext(oldpage); | ||
90 | struct page_ext *new_ext = lookup_page_ext(newpage); | ||
91 | int i; | ||
92 | |||
93 | new_ext->order = old_ext->order; | ||
94 | new_ext->gfp_mask = old_ext->gfp_mask; | ||
95 | new_ext->nr_entries = old_ext->nr_entries; | ||
96 | |||
97 | for (i = 0; i < ARRAY_SIZE(new_ext->trace_entries); i++) | ||
98 | new_ext->trace_entries[i] = old_ext->trace_entries[i]; | ||
99 | |||
100 | /* | ||
101 | * We don't clear the bit on the oldpage as it's going to be freed | ||
102 | * after migration. Until then, the info can be useful in case of | ||
103 | * a bug, and the overal stats will be off a bit only temporarily. | ||
104 | * Also, migrate_misplaced_transhuge_page() can still fail the | ||
105 | * migration and then we want the oldpage to retain the info. But | ||
106 | * in that case we also don't need to explicitly clear the info from | ||
107 | * the new page, which will be freed. | ||
108 | */ | ||
109 | __set_bit(PAGE_EXT_OWNER, &new_ext->flags); | ||
110 | } | ||
111 | |||
87 | static ssize_t | 112 | static ssize_t |
88 | print_page_owner(char __user *buf, size_t count, unsigned long pfn, | 113 | print_page_owner(char __user *buf, size_t count, unsigned long pfn, |
89 | struct page *page, struct page_ext *page_ext) | 114 | struct page *page, struct page_ext *page_ext) |