From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86FA0C433B4 for ; Tue, 20 Apr 2021 13:32:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D707260E08 for ; Tue, 20 Apr 2021 13:32:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D707260E08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Wkdlkp4zT3iP7xTq8w6hSGl8J4G/BgNA+GaHrDnvlOI=; b=A9Sm9LZxn7/SdjLGuLB4KifQ4 ymlw+1znFQRGpBfoqqLuJjhLpfIlCn6IY+cr8RznutHvaIw7QQjKICL0iSaD3V5CaEJxJq4iVgNXk gZNhXwGpM9p49hMfIucXWmqwWzclsyjcFM3M+ajx7Av5OoJ0UaYnlJRSHQXTfYr7qwUoKS63Xf6Ey UjEmUd6UkCt0k/AQuHIkIRjHbgmJpmkBQITUQY79HV6Op0gnYwmrOos6q8uiZGqh9aMOur7tQ+/uH I2mPzCR7yiJej5xbVWYZwPCJTAWtqu5PDGT42wmxUVKYKWRhJrIRxORkhHXD3DgbcXtcfMHeEEQGL c520QVXPw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYqTB-00CEA5-SB; Tue, 20 Apr 2021 13:31:14 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYqT9-00CE9C-37 for linux-arm-kernel@desiato.infradead.org; Tue, 20 Apr 2021 13:31:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QzRU1JFjLd/kV4qhF70BfRRoDchjRS5Kv7RWARnmtiY=; b=3wJ/8QEN29n0bW541MwndG0B93 PYyB3RBhSCecn5JQPUnaUoc2TbbW8kUh6OuzoGJz2g9EP0cRfkR2DAO+9TQxsGVFlOluiUQwTCxm/ 8JhVuwcdUv/VgxT76xcJzF44rMymjoMEzwnQav8eDJqPAKpEurIzPadf41J15c7XEXvQVFg2lJhyB qiywqqTdLFSfA06Ih/fXKb0mhZaJNbHSkmpB8NfwwmRHP/PyU81iMi3gkslC5z1iTt1rp6nNRJbBB qWexdQyKdxn5semdveCFSupcSgaUgRjLcJ0/nNx7zQDHiw0ewZO63n9pZ/KINsg2WK1RXeG8skn39 3qY6Tnqg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYqT6-00C9KR-EV for linux-arm-kernel@lists.infradead.org; Tue, 20 Apr 2021 13:31:09 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E56606101C; Tue, 20 Apr 2021 13:31:07 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lYqT3-008V1Z-QB; Tue, 20 Apr 2021 14:31:06 +0100 Date: Tue, 20 Apr 2021 14:31:05 +0100 Message-ID: <877dkxqe06.wl-maz@kernel.org> From: Marc Zyngier To: Yoan Picchi Cc: james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, catalin.marinas@arm.com, will@kernel.org Subject: Re: [PATCH v2 1/3] KVM: arm64: Add a stage2 page fault counter for kvm_stat In-Reply-To: <20210420130825.15585-2-yoan.picchi@arm.com> References: <20210420130825.15585-1-yoan.picchi@arm.com> <20210420130825.15585-2-yoan.picchi@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: yoan.picchi@arm.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, catalin.marinas@arm.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210420_063108_590739_41989520 X-CRM114-Status: GOOD ( 28.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 20 Apr 2021 14:08:23 +0100, Yoan Picchi wrote: > > This counter is meant to detect stage 2 page fault exits. This is meant to > measure how much those page fault influence the performance (by comparing > this number of exits to some other exit causes). > For now this counter is generic, but some more granularity is planned in > the next commits so that one know how much of the page fault are for memory > allocation, or for mmio for instance. The idea being that one using this > counter can get a better idea of what is trigerring those exits to try to > fix it. > > Signed-off-by: Yoan Picchi > --- > arch/arm64/include/asm/kvm_host.h | 1 + > arch/arm64/kvm/guest.c | 1 + > arch/arm64/kvm/mmu.c | 2 ++ > 3 files changed, 4 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 3d10e6527..02891ce94 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -561,6 +561,7 @@ struct kvm_vcpu_stat { > u64 wfi_exit_stat; > u64 mmio_exit_user; > u64 mmio_exit_kernel; > + u64 stage2_abort_exit; > u64 exits; > }; > > diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c > index 9bbd30e62..82a4b6275 100644 > --- a/arch/arm64/kvm/guest.c > +++ b/arch/arm64/kvm/guest.c > @@ -38,6 +38,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { > VCPU_STAT("wfi_exit_stat", wfi_exit_stat), > VCPU_STAT("mmio_exit_user", mmio_exit_user), > VCPU_STAT("mmio_exit_kernel", mmio_exit_kernel), > + VCPU_STAT("stage2_abort_exit", stage2_abort_exit), > VCPU_STAT("exits", exits), > VCPU_STAT("halt_poll_success_ns", halt_poll_success_ns), > VCPU_STAT("halt_poll_fail_ns", halt_poll_fail_ns), > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index 77cb2d28f..c3527ccf6 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -966,6 +966,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu) > fault_ipa = kvm_vcpu_get_fault_ipa(vcpu); > is_iabt = kvm_vcpu_trap_is_iabt(vcpu); > > + Please proofread your patches, and don't add spurious blank lines. > /* Synchronous External Abort? */ > if (kvm_vcpu_abt_issea(vcpu)) { > /* > @@ -980,6 +981,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu) > > trace_kvm_guest_fault(*vcpu_pc(vcpu), kvm_vcpu_get_esr(vcpu), > kvm_vcpu_get_hfar(vcpu), fault_ipa); > + vcpu->stat.stage2_abort_exit++; What is the benefit of this counter over, say, the tracepoint that is already in place? This tracepoint allows you to count these exits, and to actually find *why* you are exiting. If the purpose of this patch is to identify exit reasons, I'd say that the tracepoint is vastly superior in that respect. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel