[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/27] postcopy: Check for userfault+hugepage feature
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 25/27] postcopy: Check for userfault+hugepage feature |
Date: |
Tue, 28 Feb 2017 12:40:54 +0000 |
From: "Dr. David Alan Gilbert" <address@hidden>
We need extra Linux kernel support (~4.11) to support userfaults
on hugetlbfs; check for them.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/postcopy-ram.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 6b30b43..102fb61 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -81,6 +81,17 @@ static bool ufd_version_check(int ufd)
return false;
}
+ if (getpagesize() != ram_pagesize_summary()) {
+ bool have_hp = false;
+ /* We've got a huge page */
+#ifdef UFFD_FEATURE_MISSING_HUGETLBFS
+ have_hp = api_struct.features & UFFD_FEATURE_MISSING_HUGETLBFS;
+#endif
+ if (!have_hp) {
+ error_report("Userfault on this host does not support huge pages");
+ return false;
+ }
+ }
return true;
}
@@ -115,7 +126,6 @@ bool postcopy_ram_supported_by_host(void)
if (!ufd_version_check(ufd)) {
goto out;
}
- /* TODO: Only allow huge pages if the kernel supports it */
/*
* userfault and mlock don't go together; we'll put it back later if
--
2.9.3
- [Qemu-devel] [PULL 16/27] postcopy: enhance ram_block_discard_range for hugepages, (continued)
- [Qemu-devel] [PULL 16/27] postcopy: enhance ram_block_discard_range for hugepages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 17/27] postcopy: Record largest page size, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 15/27] exec: ram_block_discard_range, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 18/27] postcopy: Plumb pagesize down into place helpers, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 19/27] postcopy: Use temporary for placing zero huge pages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 20/27] postcopy: Load huge pages in one go, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 21/27] postcopy: Mask fault addresses to huge page boundary, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 22/27] postcopy: Send whole huge pages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 23/27] postcopy: Allow hugepages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 24/27] postcopy: Update userfaultfd.h header, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 25/27] postcopy: Check for userfault+hugepage feature,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 26/27] postcopy: Add doc about hugepages and postcopy, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 27/27] postcopy: Add extra check for COPY function, Dr. David Alan Gilbert (git), 2017/02/28