public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Bernhard Kauer <bk@alpico.io>,
	kvm@vger.kernel.org,  Oliver Upton <oliver.upton@linux.dev>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH] KVM: x86: Make the debugfs per VM optional
Date: Mon, 11 Nov 2024 11:11:18 -0800	[thread overview]
Message-ID: <ZzJW1nosoaovA-fF@google.com> (raw)
In-Reply-To: <CABgObfZ+ZiQWJ_x2AJ2bgModK7ziv+qUvWaS-HySq4SRwvFMCw@mail.gmail.com>

On Thu, Nov 07, 2024, Paolo Bonzini wrote:
> On Fri, Nov 1, 2024 at 6:15 PM Sean Christopherson <seanjc@google.com> wrote:
> > I'm not opposed to letting userspace say "no debugfs for me", but I don't know
> > that a module param is the right way to go.  It's obviously quite easy to
> > implement and maintain (in code), but I'm mildly concerned that it'll have limited
> > usefulness and/or lead to bad user experiences, e.g. because people turn off debugfs
> > for startup latency without entirely realizing what they're sacrificing.
> 
> What are they sacrificing? :)

For all intents and purposes, the ability to get an per-VM and per-vCPU information
from an arbitrary shell.

> The per-VM statistics information is also accessible without debugfs, even
> though kvm_stat does not support it.

I assume you're referring to KVM_GET_STATS_FD?  That's not easy to get at from
the shell.

If a host is running a single VM, then the per-VM directories aren't needed.  But
I would be very, very surprised if there's a legitimate use case for running a
single VM, with debugfs, that cares deeply about the boot latency of that one VM.

FWIW, I would be wholeheartedly in favor of providing tooling to get at stats
via KVM_GET_STATS_FD, e.g. given a VM's PID.  But then I think it would make sense
to have CONFIG_KVM_DEBUGFS, not a module param.

> However I'd make the module parameter read-only, so you don't have
> half-and-half setups. And maybe even in this mode we should create the
> directory anyway to hold the vcpu%d/pid files, which are not
> accessible in other ways.
> 
> > One potentially terrible idea would be to setup debugfs asynchronously, so that
> > the VM is runnable asap, but userspace still gets full debugfs information.  The
> > two big wrinkles would be the vCPU debugfs creation and kvm_uevent_notify_change()
> > (or at least the STATS_PATH event) would both need to be asynchronous as well.
> 
> STATS_PATH is easy because you can create the toplevel directory
> synchronously; same for vCPUs. I'd be willing to at least see what a
> patch looks like.

Ah, creating the directories synchrously would definitely simplify things.

      reply	other threads:[~2024-11-11 19:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23  8:32 [PATCH] KVM: x86: Make the debugfs per VM optional Bernhard Kauer
2024-11-01 17:15 ` Sean Christopherson
2024-11-06 22:52   ` Oliver Upton
2024-11-07 15:10   ` Paolo Bonzini
2024-11-11 19:11     ` Sean Christopherson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZzJW1nosoaovA-fF@google.com \
    --to=seanjc@google.com \
    --cc=bk@alpico.io \
    --cc=kvm@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox