lkml.org 
[lkml]   [2014]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCHv2 2/2] Change khugepaged to respect MMF_THP_DISABLE flag
On Thu, Jan 16, 2014 at 03:01:44PM -0600, Alex Thorlton wrote:
> This just adds a simple check to get khugepaged to behave
> appropriately when MMF_THP_DISABLE is set.
>
> Signed-off-by: Alex Thorlton <athorlton@sgi.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Andrea Arcangeli <aarcange@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);

__khugepaged_enter() has VM_BUG_ON(khugepaged_test_exit(mm)).
Do we really want to crash there if MMF_THP_DISABLE is set?

--
Kirill A. Shutemov


\
 
 \ /
  Last update: 2014-01-19 01:21    [W:0.115 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site