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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9836C352A1 for ; Wed, 7 Dec 2022 08:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbiLGIX3 (ORCPT ); Wed, 7 Dec 2022 03:23:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiLGIX1 (ORCPT ); Wed, 7 Dec 2022 03:23:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF2E531FB6 for ; Wed, 7 Dec 2022 00:23:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8139DB80113 for ; Wed, 7 Dec 2022 08:23:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35A80C433D6; Wed, 7 Dec 2022 08:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670401404; bh=5iZ7/58pU/UY7gbZxzZR0l9buy+u8qydHwtB5RaUOK0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QUwgm19upWK5WO/Cu8UHJN6gEZ4jhcm0EqkDV/gihZzPJQOiA/GSoNmuuDoRwbA2o OHc0/sFCthJ0Chv35wVNB5MGW4+8lUUrllFP4HM1Tv9Ogl02htpOvEZraJGRdIQMAF T0MBD6AeLR7S5npMB/DhcCF8FWNhVFtRld19QJRBBe6MkCBEGxzuQYKIXsP0dUbd8D /ni0OSroR8k7BJI9uTHkrLirEc0ZZ4+nvZvnvL0QXTvo6WP2sJ+YXjbWs0Jb6xxrBn m8OA/kNtGZAnAgcfkwf9mLI5BYwKk6CuKDt16AGhoiEqDeXZDgGrD7amQDGNpmD1T6 SX2BHX/rwxJNw== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p2pi5-00B25D-R5; Wed, 07 Dec 2022 08:23:22 +0000 Date: Wed, 07 Dec 2022 08:21:44 +0000 Message-ID: <87359rtyhz.wl-maz@kernel.org> From: Marc Zyngier To: chenxiang Cc: , , , Subject: Re: [RFC PATCH 0/2] Add vcpu debugfs to record statstical data for every single In-Reply-To: <1670331508-67322-1-git-send-email-chenxiang66@hisilicon.com> References: <1670331508-67322-1-git-send-email-chenxiang66@hisilicon.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") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: chenxiang66@hisilicon.com, pbonzini@redhat.com, james.morse@arm.com, kvm@vger.kernel.org, linuxarm@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 06 Dec 2022 12:58:26 +0000, chenxiang wrote: > > From: Xiang Chen > > Currently it only records statistical data for all vcpus, but we ofen want > to know statistical data for a single vcpu, there is no debugfs for that. > So add vcpu debugfs to record statstical data for every single vcpu, and > also enable vcpu debugfs for arm64. > > After the change, those vcpu debugfs are as follows (we have 4 vcpu in the > vm): > > [root@centos kvm]# cd 2025-14/ > [root@centos 2025-14]# ls > blocking halt_wait_hist vcpu0 > exits halt_wait_ns vcpu1 > halt_attempted_poll halt_wakeup vcpu2 > halt_poll_fail_hist hvc_exit_stat vcpu3 > halt_poll_fail_ns mmio_exit_kernel vgic-state > halt_poll_invalid mmio_exit_user wfe_exit_stat > halt_poll_success_hist remote_tlb_flush wfi_exit_stat > halt_poll_success_ns remote_tlb_flush_requests > halt_successful_poll signal_exits > [root@centos 2025-14]# cat exits > 124689 > [root@centos 2025-14]# cat vcpu0/exits > 52966 > [root@centos 2025-14]# cat vcpu1/exits > 21549 > [root@centos 2025-14]# cat vcpu2/exits > 43864 > [root@centos 2025-14]# cat vcpu3/exits > 6572 > [root@centos 2025-14]# ls vcpu0 > blocking halt_poll_invalid halt_wait_ns pid > exits halt_poll_success_hist halt_wakeup signal_exits > halt_attempted_poll halt_poll_success_ns hvc_exit_stat wfe_exit_stat > halt_poll_fail_hist halt_successful_poll mmio_exit_kernel wfi_exit_stat > halt_poll_fail_ns halt_wait_hist mmio_exit_user This is yet another example of "KVM doesn't give me the stats I want, so let's pile more stats on top". This affects every users (counters are not free), and hardly benefits anyone. How about you instead add trace hooks that allows you to plumb your own counters using BPF or another kernel module? This is what is stuff is for, and we really don't need to create more ABI around that. At least, the other stat-hungry folks out there would also be able to get their own stuff, and normal users wouldn't be affected by it. Thanks, M. -- Without deviation from the norm, progress is not possible.