Re: [PATCH] KVM: s390: track synchronous pfault events in kvm_stat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>

-- 
Thanks,

David / dhildenb




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux