thp: remove unnecessary check in start_khugepaged
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Mon, 8 Oct 2012 23:29:38 +0000 (16:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Oct 2012 07:22:25 +0000 (16:22 +0900)
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 <xiaoguangrong@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c

index 860ea912785148a41bd02e86e5299aeafa826e00..9833d8ecf38fca2e483b645252aeb1a013caabd6 100644 (file)
@@ -140,10 +140,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,
@@ -163,7 +160,7 @@ static int start_khugepaged(void)
        } else
                /* wakeup to exit */
                wake_up_interruptible(&khugepaged_wait);
-out:
+
        return err;
 }