aboutsummaryrefslogtreecommitdiffstats
path: root/mm/internal.h
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2012-11-19 07:35:47 -0500
committerMel Gorman <mgorman@suse.de>2012-12-11 09:42:57 -0500
commitb32967ff101a7508f70be8de59b278d4df92fa00 (patch)
treeb106d5eea06f97d0174f483d6a05a8b7ddd64154 /mm/internal.h
parent5bca23035391928c4c7301835accca3551b96cc2 (diff)
mm: numa: Add THP migration for the NUMA working set scanning fault case.
Note: This is very heavily based on a patch from Peter Zijlstra with fixes from Ingo Molnar, Hugh Dickins and Johannes Weiner. That patch put a lot of migration logic into mm/huge_memory.c where it does not belong. This version puts tries to share some of the migration logic with migrate_misplaced_page. However, it should be noted that now migrate.c is doing more with the pagetable manipulation than is preferred. The end result is barely recognisable so as before, the signed-offs had to be removed but will be re-added if the original authors are ok with it. Add THP migration for the NUMA working set scanning fault case. It uses the page lock to serialize. No migration pte dance is necessary because the pte is already unmapped when we decide to migrate. [dhillf@gmail.com: Fix memory leak on isolation failure] [dhillf@gmail.com: Fix transfer of last_nid information] Signed-off-by: Mel Gorman <mgorman@suse.de>
Diffstat (limited to 'mm/internal.h')
-rw-r--r--mm/internal.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/internal.h b/mm/internal.h
index a4fa284f6bc2..7e60ac826f2b 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -212,15 +212,18 @@ static inline void mlock_migrate_page(struct page *newpage, struct page *page)
212{ 212{
213 if (TestClearPageMlocked(page)) { 213 if (TestClearPageMlocked(page)) {
214 unsigned long flags; 214 unsigned long flags;
215 int nr_pages = hpage_nr_pages(page);
215 216
216 local_irq_save(flags); 217 local_irq_save(flags);
217 __dec_zone_page_state(page, NR_MLOCK); 218 __mod_zone_page_state(page_zone(page), NR_MLOCK, -nr_pages);
218 SetPageMlocked(newpage); 219 SetPageMlocked(newpage);
219 __inc_zone_page_state(newpage, NR_MLOCK); 220 __mod_zone_page_state(page_zone(newpage), NR_MLOCK, nr_pages);
220 local_irq_restore(flags); 221 local_irq_restore(flags);
221 } 222 }
222} 223}
223 224
225extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma);
226
224#ifdef CONFIG_TRANSPARENT_HUGEPAGE 227#ifdef CONFIG_TRANSPARENT_HUGEPAGE
225extern unsigned long vma_address(struct page *page, 228extern unsigned long vma_address(struct page *page,
226 struct vm_area_struct *vma); 229 struct vm_area_struct *vma);