Fix potential endless loop in kswapd when compaction is not enabled
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / vmscan.c
index 7658fd6..33c332b 100644 (file)
@@ -2946,7 +2946,8 @@ out:
                                continue;
 
                        /* Would compaction fail due to lack of free memory? */
-                       if (compaction_suitable(zone, order) == COMPACT_SKIPPED)
+                       if (COMPACTION_BUILD &&
+                           compaction_suitable(zone, order) == COMPACT_SKIPPED)
                                goto loop_again;
 
                        /* Confirm the zone is balanced for order-0 */