]> Git Repo - linux.git/blobdiff - mm/compaction.c
mm: numa: Add THP migration for the NUMA working set scanning fault case.
[linux.git] / mm / compaction.c
index 2c4ce17651d825c97c7d89ecea52bf53f17ce0aa..aee7443a4d5ac0a868af34781dbe9287d6e2c225 100644 (file)
@@ -346,7 +346,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
         * pages requested were isolated. If there were any failures, 0 is
         * returned and CMA will fail.
         */
-       if (strict && nr_strict_required != total_isolated)
+       if (strict && nr_strict_required > total_isolated)
                total_isolated = 0;
 
        if (locked)
@@ -356,6 +356,10 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
        if (blockpfn == end_pfn)
                update_pageblock_skip(cc, valid_page, total_isolated, false);
 
+       count_vm_events(COMPACTFREE_SCANNED, nr_scanned);
+       if (total_isolated)
+               count_vm_events(COMPACTISOLATED, total_isolated);
+
        return total_isolated;
 }
 
@@ -646,6 +650,10 @@ next_pageblock:
 
        trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);
 
+       count_vm_events(COMPACTMIGRATE_SCANNED, nr_scanned);
+       if (nr_isolated)
+               count_vm_events(COMPACTISOLATED, nr_isolated);
+
        return low_pfn;
 }
 
@@ -990,14 +998,11 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
                nr_migrate = cc->nr_migratepages;
                err = migrate_pages(&cc->migratepages, compaction_alloc,
                                (unsigned long)cc, false,
-                               cc->sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC);
+                               cc->sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC,
+                               MR_COMPACTION);
                update_nr_listpages(cc);
                nr_remaining = cc->nr_migratepages;
 
-               count_vm_event(COMPACTBLOCKS);
-               count_vm_events(COMPACTPAGES, nr_migrate - nr_remaining);
-               if (nr_remaining)
-                       count_vm_events(COMPACTPAGEFAILED, nr_remaining);
                trace_mm_compaction_migratepages(nr_migrate - nr_remaining,
                                                nr_remaining);
 
This page took 0.03202 seconds and 4 git commands to generate.