aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2012-03-24 10:26:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-24 15:18:32 -0400
commit496b919b3bdd957d4b1727df79bfa3751bced1c1 (patch)
tree5585608ebdce5a7eca8f5ef334e6b167fcd5aab1 /mm/vmscan.c
parent250f6715a4112d6686670c5a62ceb9305da94616 (diff)
Fix potential endless loop in kswapd when compaction is not enabled
We should only test compaction_suitable if the kernel is built with CONFIG_COMPACTION, otherwise the stub compaction_suitable function will always return COMPACT_SKIPPED and send kswapd into an infinite loop. Reported-by: Anton Blanchard <anton@samba.org> Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 7658fd6536dd..33c332bbab73 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2946,7 +2946,8 @@ out:
2946 continue; 2946 continue;
2947 2947
2948 /* Would compaction fail due to lack of free memory? */ 2948 /* Would compaction fail due to lack of free memory? */
2949 if (compaction_suitable(zone, order) == COMPACT_SKIPPED) 2949 if (COMPACTION_BUILD &&
2950 compaction_suitable(zone, order) == COMPACT_SKIPPED)
2950 goto loop_again; 2951 goto loop_again;
2951 2952
2952 /* Confirm the zone is balanced for order-0 */ 2953 /* Confirm the zone is balanced for order-0 */