linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thp: do not adjust zone water marks if khugepaged is not started
@ 2015-03-27 11:39 Kirill A. Shutemov
  2015-03-27 21:47 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Kirill A. Shutemov @ 2015-03-27 11:39 UTC (permalink / raw)
  To: Andrew Morton, David Rientjes
  Cc: Andrea Arcangeli, linux-mm, Kirill A. Shutemov

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>
---
 mm/huge_memory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index a1594b18bc1b..370a3bbc960d 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)
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-02 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-27 11:39 [PATCH] thp: do not adjust zone water marks if khugepaged is not started Kirill A. Shutemov
2015-03-27 21:47 ` Andrew Morton
2015-03-27 22:00   ` Andrew Morton
2015-03-27 22:08     ` Kirill A. Shutemov
2015-04-02 12:08     ` Kirill A. Shutemov
2015-03-27 22:00   ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).