Re: [RFC 2/3] x86: KVM: stats: Add stat counter for IRQs injected via APICv
From: Sean Christopherson
Date: Tue Apr 16 2024 - 14:25:33 EST
On Thu, Feb 15, 2024, Alejandro Jimenez wrote:
> Hi Dongli
>
> On 2/15/24 11:16, Dongli Zhang wrote:
> > Hi Alejandro,
> >
> > Is there any use case of this counter in the bug?
>
> I don't have a specific bug in mind that this is trying to address. This
> patch is just an example is to show how existing data points (i.e. the
> trace_kvm_apicv_accept_irq tracepoint) can also be exposed via the stats
> framework with minimal overhead, and to support the point in the cover letter
> that querying the binary stats could be the best choice for a "single source"
> that tells us the full status of APICv/AVIC (i.e. is SVM and IOMMU AVIC both
> working, are there any inhibits set, etc)
Yeah, but as noted in my response to the cover letter, stats are ABI, whereas
tracepoints are not, i.e. the bar for adding stats is much higher than the bar
for adding tracepoints.
In other words, stats need to come with a concrete use case (preferably more than
one), an explanation of why userspace needs a KVM-provided stat, and a decent
level of confidence that KVM can provide deterministic, sane, and broadly useful
data.
E.g. this proposed stat is of limited usefulness because it applies to a very
narrow combination of IRQs and hardware.