提交 496b919b 编写于 作者: R Rik van Riel 提交者: Linus Torvalds

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: NAnton Blanchard <anton@samba.org>
Signed-off-by: NRik van Riel <riel@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 250f6715
......@@ -2946,7 +2946,8 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册