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 75D6EC4708D for ; Wed, 7 Dec 2022 11:10:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiLGLKk (ORCPT ); Wed, 7 Dec 2022 06:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbiLGLJ4 (ORCPT ); Wed, 7 Dec 2022 06:09:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AAF6F04 for ; Wed, 7 Dec 2022 03:09:41 -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 062E4B81C23 for ; Wed, 7 Dec 2022 11:09:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B50B7C433D6; Wed, 7 Dec 2022 11:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670411378; bh=CqlhtCs7ZPasm18mI3pAVKZ0rgCoqgzOBENcJNyGaoY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ujIrDpr3QMm1YJiWwT7LXTjWRkZk/RU0Z8M1BvWa8qG0r1l6KRyZG5CV58dPeBlTu CXMq/FgQGnekjic26qWZDyPYjPua75QFKC21CAZNW6Z5ayC1cwf43Ps9/t3vl2T4o7 cccNn8WDUWquD0RWpx02c+4AK1XMtDkYgJ1T6653n4CbiOni4nqlWiUUUfRBh5RrL0 EDPWdZMM+ntmmxvb2h2UCcY4jcylxNG03+FaRdg+Gaez8ZtN1AOgPmbECNpqCc3/kV 2dnnjwyMw9RCaTIL+mnHz5igWqpOvwZ5kO/s7zHsj7IcBIyOkFZ1+CN2njxVQNnAB5 oI0I0th4DxDrQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1p2sIy-00B4Y0-I1; Wed, 07 Dec 2022 11:09:36 +0000 Date: Wed, 07 Dec 2022 11:09:36 +0000 Message-ID: <86h6y7lbbj.wl-maz@kernel.org> From: Marc Zyngier To: "chenxiang (M)" Cc: , , , Subject: Re: [RFC PATCH 0/2] Add vcpu debugfs to record statstical data for every single In-Reply-To: References: <1670331508-67322-1-git-send-email-chenxiang66@hisilicon.com> <87359rtyhz.wl-maz@kernel.org> 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 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 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 Wed, 07 Dec 2022 10:16:17 +0000, "chenxiang (M)" wrote: >=20 >=20 >=20 > =E5=9C=A8 2022/12/7 16:21, Marc Zyngier =E5=86=99=E9=81=93: > > On Tue, 06 Dec 2022 12:58:26 +0000, > > chenxiang wrote: > >> From: Xiang Chen > >>=20 > >> 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 th= at. > >> So add vcpu debugfs to record statstical data for every single vcpu, a= nd > >> also enable vcpu debugfs for arm64. > >>=20 > >> After the change, those vcpu debugfs are as follows (we have 4 vcpu in= the > >> vm): > >>=20 > >> [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_exi= t_stat > >> halt_poll_fail_hist halt_successful_poll mmio_exit_kernel wfi_exi= t_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. >=20 > Currently it already has vcpu debugfs on top, but it only records > statstical data for total vm > which is helpless for debug, for example, file exists records the > number of VM exist for all vcpus, before we encountered a > issue that there is something wrong with the thread of a vcpu which > doesn't VM exit but other vcpus are normal, > we can't get anything useful from current vcpu debugfs as the number > of exits still increase in current vcpu debugfs. > Compared with current vcpu debugfs, i think it is more useful to know > the statstical data for every vcpu and it benefits more. What is useful for you is useless for somebody else. And vice versa. At the end of the day, this is *debug* stuff. Why should a normal user pay a price for *debug* counters? > > 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. The answer to your problems is ^^^HERE^^^. M. --=20 Without deviation from the norm, progress is not possible.