Merge tag 'mm-stable-2022-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / mm / compaction.c
index a2c53fc..640fa76 100644 (file)
@@ -613,6 +613,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
                        break;
                set_page_private(page, order);
 
+               nr_scanned += isolated - 1;
                total_isolated += isolated;
                cc->nr_freepages += isolated;
                list_add_tail(&page->lru, freelist);
@@ -1099,6 +1100,7 @@ isolate_success:
 isolate_success_no_list:
                cc->nr_migratepages += compound_nr(page);
                nr_isolated += compound_nr(page);
+               nr_scanned += compound_nr(page) - 1;
 
                /*
                 * Avoid isolating too much unless this block is being
@@ -1502,6 +1504,7 @@ fast_isolate_freepages(struct compact_control *cc)
                        if (__isolate_free_page(page, order)) {
                                set_page_private(page, order);
                                nr_isolated = 1 << order;
+                               nr_scanned += nr_isolated - 1;
                                cc->nr_freepages += nr_isolated;
                                list_add_tail(&page->lru, &cc->freepages);
                                count_compact_events(COMPACTISOLATED, nr_isolated);
@@ -3009,7 +3012,7 @@ void kcompactd_run(int nid)
 
 /*
  * Called by memory hotplug when all memory in a node is offlined. Caller must
- * hold mem_hotplug_begin/end().
+ * be holding mem_hotplug_begin/done().
  */
 void kcompactd_stop(int nid)
 {