]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
mm/huge_memory: replace VM_NO_THP VM_BUG_ON with actual VMA check
authorKonstantin Khlebnikov <koct9i@gmail.com>
Thu, 28 Apr 2016 23:18:32 +0000 (16:18 -0700)
committerKamal Mostafa <kamal@canonical.com>
Mon, 16 May 2016 17:26:32 +0000 (10:26 -0700)
commita1efe66052e0466f8cdeb24bff1ed9e575a114b4
tree29e7a8d731709a05da1ec78adb8dd05f4ef7773b
parent58b53d2874f656f6083dbe64fa5eb9c1bdfc278c
mm/huge_memory: replace VM_NO_THP VM_BUG_ON with actual VMA check

BugLink: http://bugs.launchpad.net/bugs/1578798
commit 3486b85a29c1741db99d0c522211c82d2b7a56d0 upstream.

Khugepaged detects own VMAs by checking vm_file and vm_ops but this way
it cannot distinguish private /dev/zero mappings from other special
mappings like /dev/hpet which has no vm_ops and popultes PTEs in mmap.

This fixes false-positive VM_BUG_ON and prevents installing THP where
they are not expected.

Link: http://lkml.kernel.org/r/CACT4Y+ZmuZMV5CjSFOeXviwQdABAgT7T+StKfTqan9YDtgEi5g@mail.gmail.com
Fixes: 78f11a255749 ("mm: thp: fix /dev/zero MAP_PRIVATE and vm_flags cleanups")
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
mm/huge_memory.c