This just adds a simple check to get khugepaged to behave
appropriately when MMF_THP_DISABLE is set.

Signed-off-by: Alex Thorlton <athorl...@sgi.com>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shute...@linux.intel.com>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: Rik van Riel <r...@redhat.com>
Cc: Naoya Horiguchi <n-horigu...@ah.jp.nec.com>
Cc: Oleg Nesterov <o...@redhat.com>
Cc: "Eric W. Biederman" <ebied...@xmission.com>
Cc: Andy Lutomirski <l...@amacapital.net>
Cc: Al Viro <v...@zeniv.linux.org.uk>
Cc: Kees Cook <keesc...@chromium.org>
Cc: Andrea Arcangeli <aarca...@redhat.com>
Cc: linux-kernel@vger.kernel.org

---
 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 9c0b172..3cfe6b4 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2049,7 +2049,8 @@ static void insert_to_mm_slots_hash(struct mm_struct *mm,
 
 static inline int khugepaged_test_exit(struct mm_struct *mm)
 {
-       return atomic_read(&mm->mm_users) == 0;
+       return atomic_read(&mm->mm_users) == 0 ||
+              (mm->flags & MMF_THP_DISABLE_MASK);
 }
 
 int __khugepaged_enter(struct mm_struct *mm)
-- 
1.7.12.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to