From d9429f1e8dafc294a187ea008db8c99a9c34a60e Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Fri, 28 Sep 2012 10:19:16 +1000 Subject: [PATCH] thp: remove unnecessary check in start_khugepaged The check is unnecessary since if mm_slot_cache or mm_slots_hash initialize failed, no sysfs interface will be created Signed-off-by: Xiao Guangrong Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: David Rientjes Signed-off-by: Andrew Morton --- mm/huge_memory.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 13a1ff52c42a..2db4aef80f9d 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -141,10 +141,7 @@ static int start_khugepaged(void) int err = 0; if (khugepaged_enabled()) { int wakeup; - if (unlikely(!mm_slot_cache || !mm_slots_hash)) { - err = -ENOMEM; - goto out; - } + mutex_lock(&khugepaged_mutex); if (!khugepaged_thread) khugepaged_thread = kthread_run(khugepaged, NULL, @@ -164,7 +161,7 @@ static int start_khugepaged(void) } else /* wakeup to exit */ wake_up_interruptible(&khugepaged_wait); -out: + return err; } -- 2.39.5