mm: compaction: clear PG_migrate_skip based on compaction and reclaim activity
[cascardo/linux.git] / mm / vmscan.c
index 1ee4b69..b010efc 100644 (file)
@@ -2895,6 +2895,14 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, int classzone_idx)
                 */
                set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold);
 
+               /*
+                * Compaction records what page blocks it recently failed to
+                * isolate pages from and skips them in the future scanning.
+                * When kswapd is going to sleep, it is reasonable to assume
+                * that pages and compaction may succeed so reset the cache.
+                */
+               reset_isolation_suitable(pgdat);
+
                if (!kthread_should_stop())
                        schedule();