]> git.baikalelectronics.ru Git - kernel.git/commit
mm: loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390
authorJason J. Herne <jjherne@linux.vnet.ibm.com>
Fri, 20 Nov 2015 23:57:04 +0000 (15:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Nov 2015 00:17:32 +0000 (16:17 -0800)
commitec3a916bf848b04d1a4729dac1c93ea2958c7de9
treeff7dac4e67a0d7121b156b6e06544b5c94469f53
parentb43b4e3c6f6f8fe1f37981a63ff39b4c3eff15b6
mm: loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390

MADV_NOHUGEPAGE processing is too restrictive.  kvm already disables
hugepage but hugepage_madvise() takes the error path when we ask to turn
on the MADV_NOHUGEPAGE bit and the bit is already on.  This causes Qemu's
new postcopy migration feature to fail on s390 because its first action is
to madvise the guest address space as NOHUGEPAGE.  This patch modifies the
code so that the operation succeeds without error now.

For consistency reasons do the same for MADV_HUGEPAGE.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c