From: Kirill A. Shutemov Date: Tue, 7 Apr 2015 23:44:32 +0000 (+1000) Subject: thp: do not adjust zone water marks if khugepaged is not started X-Git-Tag: KARO-TXA5-2015-06-26~18^2~286 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=804dfc741fea9e91dffce6f40540eb239448e795;p=karo-tx-linux.git thp: do not adjust zone water marks if khugepaged is not started set_recommended_min_free_kbytes() adjusts zone water marks to be suitable for khugepaged. We avoid doing this if khugepaged is disabled, but don't catch the case when khugepaged is failed to start. Let's address this by checking khugepaged_thread instead of khugepaged_enabled() in set_recommended_min_free_kbytes(). It's NULL if the kernel thread is stopped or failed to start. Signed-off-by: Kirill A. Shutemov Cc: David Rientjes Cc: Andrea Arcangeli Signed-off-by: Andrew Morton --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 902da2014f7c..91d6639b2f83 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -110,7 +110,8 @@ static int set_recommended_min_free_kbytes(void) int nr_zones = 0; unsigned long recommended_min; - if (!khugepaged_enabled()) + /* khugepaged thread has stopped to failed to start */ + if (!khugepaged_thread) return 0; for_each_populated_zone(zone)