[lkml]   [2019]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v3 0/3] kvm: Use huge pages for DAX-backed files
This patch series depends on DAX pages not being PageReserved.  Once
that is in place, these changes will let KVM use huge pages with
DAX-backed files.

From previous discussions[1], it sounds like DAX might not need to keep
the PageReserved bit, but that it hadn't been sorted out yet.

Without the PageReserved change, KVM and DAX still work with these
patches, simply without huge pages - which is the current situation.

If you want to test the huge-page functionality as if DAX pages weren't
PageReserved for KVM, this hack does the trick:

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index c44985375e7f..ee539eec1fb8 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -153,6 +153,10 @@ __weak int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,

bool kvm_is_reserved_pfn(kvm_pfn_t pfn)
+ // XXX hack
+ if (is_zone_device_page(pfn_to_page(pfn)))
+ return false;
if (pfn_valid(pfn))
return PageReserved(pfn_to_page(pfn));

Perhaps if we are going to leave DAX pages marked PageReserved, then I
can make that hack into a proper commit and have KVM alone treat DAX
pages as if they are not reserved.

v2 -> v3:
- Updated Acks/Reviewed-by
- Rebased onto linux-next

v1 -> v2:
- Updated Acks/Reviewed-by
- Minor touchups
- Added patch to remove redundant PageReserved() check
- Rebased onto linux-next

RFC/discussion thread:


Barret Rhoden (3):
mm: make dev_pagemap_mapping_shift() externally visible
kvm: Use huge pages for DAX-backed files
kvm: remove redundant PageReserved() check

arch/x86/kvm/mmu.c | 33 +++++++++++++++++++++++++++++++--
include/linux/mm.h | 3 +++
mm/memory-failure.c | 38 +++-----------------------------------
mm/util.c | 34 ++++++++++++++++++++++++++++++++++
virt/kvm/kvm_main.c | 8 ++------
5 files changed, 73 insertions(+), 43 deletions(-)

 \ /
  Last update: 2019-04-04 22:27    [W:0.055 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site