Skip to content

Commit

Permalink
thp: remove unnecessary check in start_khugepaged
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiao Guangrong authored and Linus Torvalds committed Oct 9, 2012
1 parent 65b3c07 commit 637e3a2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -163,7 +160,7 @@ static int start_khugepaged(void)
} else
/* wakeup to exit */
wake_up_interruptible(&khugepaged_wait);
out:

return err;
}

Expand Down

0 comments on commit 637e3a2

Please sign in to comment.