mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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>
This commit is contained in:
parent
250f6715a4
commit
496b919b3b
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user