diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 9e7cec2840927..cb17091d0a202 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -435,7 +435,7 @@ int __khugepaged_enter(struct mm_struct *mm) return -ENOMEM; /* __khugepaged_exit() must not run from under us */ - VM_BUG_ON_MM(khugepaged_test_exit(mm), mm); + VM_BUG_ON_MM(atomic_read(&mm->mm_users) == 0, mm); if (unlikely(test_and_set_bit(MMF_VM_HUGEPAGE, &mm->flags))) { free_mm_slot(mm_slot); return 0;