All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: s390: track synchronous pfault events in kvm_stat
@ 2020-11-25  9:06 Christian Borntraeger
  2020-11-25  9:07 ` David Hildenbrand
  2020-11-25  9:31 ` Cornelia Huck
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Borntraeger @ 2020-11-25  9:06 UTC (permalink / raw)
  To: Janosch Frank
  Cc: KVM, Cornelia Huck, Christian Borntraeger, David Hildenbrand, linux-s390

Right now we do count pfault (pseudo page faults aka async page faults
start and completion events). What we do not count is, if an async page
fault would have been possible by the host, but it was disabled by the
guest (e.g. interrupts off, pfault disabled, secure execution....).  Let
us count those as well in the pfault_sync counter.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/kvm_host.h | 1 +
 arch/s390/kvm/kvm-s390.c         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 463c24e26000..74f9a036bab2 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -459,6 +459,7 @@ struct kvm_vcpu_stat {
 	u64 diagnose_308;
 	u64 diagnose_500;
 	u64 diagnose_other;
+	u64 pfault_sync;
 };
 
 #define PGM_OPERATION			0x01
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 282a13ece554..dbafd057ca6a 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -60,6 +60,7 @@
 struct kvm_stats_debugfs_item debugfs_entries[] = {
 	VCPU_STAT("userspace_handled", exit_userspace),
 	VCPU_STAT("exit_null", exit_null),
+	VCPU_STAT("pfault_sync", pfault_sync),
 	VCPU_STAT("exit_validity", exit_validity),
 	VCPU_STAT("exit_stop_request", exit_stop_request),
 	VCPU_STAT("exit_external_request", exit_external_request),
@@ -4109,6 +4110,7 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
 		current->thread.gmap_pfault = 0;
 		if (kvm_arch_setup_async_pf(vcpu))
 			return 0;
+		vcpu->stat.pfault_sync++;
 		return kvm_arch_fault_in_page(vcpu, current->thread.gmap_addr, 1);
 	}
 	return vcpu_post_run_fault_in_sie(vcpu);
-- 
2.28.0

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

* Re: [PATCH] KVM: s390: track synchronous pfault events in kvm_stat
  2020-11-25  9:06 [PATCH] KVM: s390: track synchronous pfault events in kvm_stat Christian Borntraeger
@ 2020-11-25  9:07 ` David Hildenbrand
  2020-11-25  9:31 ` Cornelia Huck
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2020-11-25  9:07 UTC (permalink / raw)
  To: Christian Borntraeger, Janosch Frank; +Cc: KVM, Cornelia Huck, linux-s390

On 25.11.20 10:06, Christian Borntraeger wrote:
> Right now we do count pfault (pseudo page faults aka async page faults
> start and completion events). What we do not count is, if an async page
> fault would have been possible by the host, but it was disabled by the
> guest (e.g. interrupts off, pfault disabled, secure execution....).  Let
> us count those as well in the pfault_sync counter.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  arch/s390/include/asm/kvm_host.h | 1 +
>  arch/s390/kvm/kvm-s390.c         | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
> index 463c24e26000..74f9a036bab2 100644
> --- a/arch/s390/include/asm/kvm_host.h
> +++ b/arch/s390/include/asm/kvm_host.h
> @@ -459,6 +459,7 @@ struct kvm_vcpu_stat {
>  	u64 diagnose_308;
>  	u64 diagnose_500;
>  	u64 diagnose_other;
> +	u64 pfault_sync;
>  };
>  
>  #define PGM_OPERATION			0x01
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 282a13ece554..dbafd057ca6a 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -60,6 +60,7 @@
>  struct kvm_stats_debugfs_item debugfs_entries[] = {
>  	VCPU_STAT("userspace_handled", exit_userspace),
>  	VCPU_STAT("exit_null", exit_null),
> +	VCPU_STAT("pfault_sync", pfault_sync),
>  	VCPU_STAT("exit_validity", exit_validity),
>  	VCPU_STAT("exit_stop_request", exit_stop_request),
>  	VCPU_STAT("exit_external_request", exit_external_request),
> @@ -4109,6 +4110,7 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
>  		current->thread.gmap_pfault = 0;
>  		if (kvm_arch_setup_async_pf(vcpu))
>  			return 0;
> +		vcpu->stat.pfault_sync++;
>  		return kvm_arch_fault_in_page(vcpu, current->thread.gmap_addr, 1);
>  	}
>  	return vcpu_post_run_fault_in_sie(vcpu);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb

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

* Re: [PATCH] KVM: s390: track synchronous pfault events in kvm_stat
  2020-11-25  9:06 [PATCH] KVM: s390: track synchronous pfault events in kvm_stat Christian Borntraeger
  2020-11-25  9:07 ` David Hildenbrand
@ 2020-11-25  9:31 ` Cornelia Huck
  1 sibling, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2020-11-25  9:31 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: Janosch Frank, KVM, David Hildenbrand, linux-s390

On Wed, 25 Nov 2020 10:06:58 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> Right now we do count pfault (pseudo page faults aka async page faults
> start and completion events). What we do not count is, if an async page
> fault would have been possible by the host, but it was disabled by the
> guest (e.g. interrupts off, pfault disabled, secure execution....).  Let
> us count those as well in the pfault_sync counter.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  arch/s390/include/asm/kvm_host.h | 1 +
>  arch/s390/kvm/kvm-s390.c         | 2 ++
>  2 files changed, 3 insertions(+)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

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

end of thread, other threads:[~2020-11-25  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  9:06 [PATCH] KVM: s390: track synchronous pfault events in kvm_stat Christian Borntraeger
2020-11-25  9:07 ` David Hildenbrand
2020-11-25  9:31 ` Cornelia Huck

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.