aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2015-04-15 19:14:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 19:35:19 -0400
commitae7efa507dee4813ec4bcdadebeec191e247d0c9 (patch)
tree71843a088245b34c908a143f943fe5d924bd9706 /mm
parent65ebb64f4d2ce8eba4d0ec82d6cf65022e70e4a1 (diff)
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 <kirill.shutemov@linux.intel.com> Cc: David Rientjes <rientjes@google.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/huge_memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c257006749bb..0af19fffe1df 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -110,7 +110,8 @@ static int set_recommended_min_free_kbytes(void)
110 int nr_zones = 0; 110 int nr_zones = 0;
111 unsigned long recommended_min; 111 unsigned long recommended_min;
112 112
113 if (!khugepaged_enabled()) 113 /* khugepaged thread has stopped to failed to start */
114 if (!khugepaged_thread)
114 return 0; 115 return 0;
115 116
116 for_each_populated_zone(zone) 117 for_each_populated_zone(zone)