All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: Loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390
@ 2015-11-12 15:18 Jason J. Herne
  2015-11-12 16:45 ` Christian Borntraeger
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Jason J. Herne @ 2015-11-12 15:18 UTC (permalink / raw)
  To: linux-s390; +Cc: linux-mm, akpm, aarcange, borntraeger, Jason J. Herne

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.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
---
 mm/huge_memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c29ddeb..62fe06b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2009,7 +2009,7 @@ int hugepage_madvise(struct vm_area_struct *vma,
 		/*
 		 * Be somewhat over-protective like KSM for now!
 		 */
-		if (*vm_flags & (VM_HUGEPAGE | VM_NO_THP))
+		if (*vm_flags & VM_NO_THP)
 			return -EINVAL;
 		*vm_flags &= ~VM_NOHUGEPAGE;
 		*vm_flags |= VM_HUGEPAGE;
@@ -2025,7 +2025,7 @@ int hugepage_madvise(struct vm_area_struct *vma,
 		/*
 		 * Be somewhat over-protective like KSM for now!
 		 */
-		if (*vm_flags & (VM_NOHUGEPAGE | VM_NO_THP))
+		if (*vm_flags & VM_NO_THP)
 			return -EINVAL;
 		*vm_flags &= ~VM_HUGEPAGE;
 		*vm_flags |= VM_NOHUGEPAGE;
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 23+ messages in thread
* [PATCH] mm: Loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390
@ 2015-11-11 15:35 Jason J. Herne
  2015-11-11 17:30 ` Andrea Arcangeli
  0 siblings, 1 reply; 23+ messages in thread
From: Jason J. Herne @ 2015-11-11 15:35 UTC (permalink / raw)
  To: linux-s390; +Cc: linux-mm, aarcange, borntraeger, Jason J. Herne

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.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c29ddeb..a8b5347 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2025,7 +2025,7 @@ int hugepage_madvise(struct vm_area_struct *vma,
 		/*
 		 * Be somewhat over-protective like KSM for now!
 		 */
-		if (*vm_flags & (VM_NOHUGEPAGE | VM_NO_THP))
+		if (*vm_flags & VM_NO_THP)
 			return -EINVAL;
 		*vm_flags &= ~VM_HUGEPAGE;
 		*vm_flags |= VM_NOHUGEPAGE;
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-11-19 14:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12 15:18 [PATCH] mm: Loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390 Jason J. Herne
2015-11-12 16:45 ` Christian Borntraeger
2015-11-13 22:58 ` David Rientjes
     [not found] ` <1447341516-18076-1-git-send-email-jjherne-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2015-11-18 13:31   ` Vlastimil Babka
2015-11-18 13:31     ` Vlastimil Babka
2015-11-19  8:22     ` Christian Borntraeger
2015-11-19  8:22       ` [Qemu-devel] " Christian Borntraeger
     [not found]       ` <564D86AE.1010305-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2015-11-19  9:31         ` Vlastimil Babka
2015-11-19  9:31           ` [Qemu-devel] " Vlastimil Babka
2015-11-19  9:31           ` Vlastimil Babka
2015-11-19  9:43       ` Dr. David Alan Gilbert
2015-11-19  9:43         ` [Qemu-devel] " Dr. David Alan Gilbert
2015-11-19 13:10       ` Dr. David Alan Gilbert
2015-11-19 14:30         ` Jason J. Herne
  -- strict thread matches above, loose matches on Subject: below --
2015-11-11 15:35 Jason J. Herne
2015-11-11 17:30 ` Andrea Arcangeli
2015-11-11 19:47   ` Christian Borntraeger
2015-11-11 19:47     ` Christian Borntraeger
2015-11-11 20:42     ` Andrea Arcangeli
2015-11-11 20:42       ` Andrea Arcangeli
2015-11-11 20:01   ` Christian Borntraeger
2015-11-11 20:37     ` Andrea Arcangeli
2015-11-11 20:37       ` Andrea Arcangeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.