All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zenghui Yu <yuzenghui@huawei.com>
To: <christoffer.dall@arm.com>, <marc.zyngier@arm.com>
Cc: <james.morse@arm.com>, <julien.thierry@arm.com>,
	<suzuki.poulose@arm.com>, <wanghaibin.wang@huawei.com>,
	<kvmarm@lists.cs.columbia.edu>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, Zenghui Yu <yuzenghui@huawei.com>,
	Punit Agrawal <punit.agrawal@arm.com>
Subject: [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled
Date: Sat, 2 Mar 2019 03:35:28 +0000	[thread overview]
Message-ID: <1551497728-12576-1-git-send-email-yuzenghui@huawei.com> (raw)

The idea behind this is: we don't want to keep tracking of huge pages when
logging_active is true, which will result in performance degradation.  We
still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it
to force a PTE mapping.

Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>

---
Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the
"vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far
as I can tell, we used to have "hugetlb" to force the PTE mapping, but
we have "vma_pagesize" currently instead. We should set it properly for
performance reasons (e.g, in VM migration). Did I miss something important?

---
 virt/kvm/arm/mmu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 30251e2..7d41b16 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 	     (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) &&
 	    !force_pte) {
 		gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT;
+	} else {
+		/*
+		 * Fallback to PTE if it's not one of the stage2
+		 * supported hugepage sizes or the corresponding level
+		 * doesn't exist, or logging is enabled.
+		 */
+		vma_pagesize = PAGE_SIZE;
 	}
 	up_read(&current->mm->mmap_sem);
 
-- 
1.8.3.1



WARNING: multiple messages have this Message-ID (diff)
From: Zenghui Yu <yuzenghui@huawei.com>
To: christoffer.dall@arm.com, marc.zyngier@arm.com
Cc: james.morse@arm.com, julien.thierry@arm.com,
	suzuki.poulose@arm.com, wanghaibin.wang@huawei.com,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Zenghui Yu <yuzenghui@huawei.com>,
	Punit Agrawal <punit.agrawal@arm.com>
Subject: [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled
Date: Sat, 2 Mar 2019 03:35:28 +0000	[thread overview]
Message-ID: <1551497728-12576-1-git-send-email-yuzenghui@huawei.com> (raw)

The idea behind this is: we don't want to keep tracking of huge pages when
logging_active is true, which will result in performance degradation.  We
still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it
to force a PTE mapping.

Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>

---
Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the
"vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far
as I can tell, we used to have "hugetlb" to force the PTE mapping, but
we have "vma_pagesize" currently instead. We should set it properly for
performance reasons (e.g, in VM migration). Did I miss something important?

---
 virt/kvm/arm/mmu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 30251e2..7d41b16 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 	     (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) &&
 	    !force_pte) {
 		gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT;
+	} else {
+		/*
+		 * Fallback to PTE if it's not one of the stage2
+		 * supported hugepage sizes or the corresponding level
+		 * doesn't exist, or logging is enabled.
+		 */
+		vma_pagesize = PAGE_SIZE;
 	}
 	up_read(&current->mm->mmap_sem);
 
-- 
1.8.3.1

WARNING: multiple messages have this Message-ID (diff)
From: Zenghui Yu <yuzenghui@huawei.com>
To: <christoffer.dall@arm.com>, <marc.zyngier@arm.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>,
	suzuki.poulose@arm.com, julien.thierry@arm.com,
	linux-kernel@vger.kernel.org, james.morse@arm.com,
	Zenghui Yu <yuzenghui@huawei.com>,
	wanghaibin.wang@huawei.com, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled
Date: Sat, 2 Mar 2019 03:35:28 +0000	[thread overview]
Message-ID: <1551497728-12576-1-git-send-email-yuzenghui@huawei.com> (raw)

The idea behind this is: we don't want to keep tracking of huge pages when
logging_active is true, which will result in performance degradation.  We
still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it
to force a PTE mapping.

Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>

---
Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the
"vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far
as I can tell, we used to have "hugetlb" to force the PTE mapping, but
we have "vma_pagesize" currently instead. We should set it properly for
performance reasons (e.g, in VM migration). Did I miss something important?

---
 virt/kvm/arm/mmu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 30251e2..7d41b16 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 	     (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) &&
 	    !force_pte) {
 		gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT;
+	} else {
+		/*
+		 * Fallback to PTE if it's not one of the stage2
+		 * supported hugepage sizes or the corresponding level
+		 * doesn't exist, or logging is enabled.
+		 */
+		vma_pagesize = PAGE_SIZE;
 	}
 	up_read(&current->mm->mmap_sem);
 
-- 
1.8.3.1



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-03-02  3:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02  3:35 Zenghui Yu [this message]
2019-03-02  3:35 ` [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled Zenghui Yu
2019-03-02  3:35 ` Zenghui Yu
2019-03-03 15:14 ` Zenghui Yu
2019-03-03 15:14   ` Zenghui Yu
2019-03-03 15:14   ` Zenghui Yu
2019-03-04 17:13   ` Suzuki K Poulose
2019-03-04 17:13     ` Suzuki K Poulose
2019-03-04 17:13     ` Suzuki K Poulose
2019-03-04 17:34     ` Marc Zyngier
2019-03-04 17:34       ` Marc Zyngier
2019-03-04 17:34       ` Marc Zyngier
2019-03-05 11:09       ` Zenghui Yu
2019-03-05 11:09         ` Zenghui Yu
2019-03-05 11:09         ` Zenghui Yu
2019-03-05 11:13         ` Suzuki K Poulose
2019-03-05 11:13           ` Suzuki K Poulose
2019-03-05 11:32           ` Zenghui Yu
2019-03-05 11:32             ` Zenghui Yu
2019-03-05 11:32             ` Zenghui Yu
2019-03-05 11:51         ` Marc Zyngier
2019-03-05 11:51           ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1551497728-12576-1-git-send-email-yuzenghui@huawei.com \
    --to=yuzenghui@huawei.com \
    --cc=christoffer.dall@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=punit.agrawal@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=wanghaibin.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.