From: Sean Christopherson <seanjc@google.com>
To: Bernhard Kauer <bk@alpico.io>
Cc: kvm@vger.kernel.org, Oliver Upton <oliver.upton@linux.dev>,
Marc Zyngier <maz@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] KVM: x86: Make the debugfs per VM optional
Date: Fri, 1 Nov 2024 10:15:00 -0700 [thread overview]
Message-ID: <ZyUMlFSjNTJdQpU6@google.com> (raw)
In-Reply-To: <20241023083237.184359-1-bk@alpico.io>
+Paolo and others
Please use scripts/get_maintainer.pl, otherwise your patches are likely to be
missed by key folks (Paolo, in this case).
On Wed, Oct 23, 2024, Bernhard Kauer wrote:
> Creating a debugfs directory for each virtual machine is a suprisingly
> costly operation as one has to synchronize multiple cores. However, short
> living VMs seldom benefit from it.
>
> Since there are valid use-cases we make this feature optional via a
> module parameter. Disabling it saves 150us in the hello microbenchmark.
>
> Signed-off-by: Bernhard Kauer <bk@alpico.io>
> ---
> virt/kvm/kvm_main.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index a48861363649..760e39cf86a8 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -94,6 +94,9 @@ unsigned int halt_poll_ns_shrink = 2;
> module_param(halt_poll_ns_shrink, uint, 0644);
> EXPORT_SYMBOL_GPL(halt_poll_ns_shrink);
>
> +bool debugfs_per_vm = true;
> +module_param(debugfs_per_vm, bool, 0644);
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.
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.
next prev parent reply other threads:[~2024-11-01 17:15 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 [this message]
2024-11-06 22:52 ` Oliver Upton
2024-11-07 15:10 ` Paolo Bonzini
2024-11-11 19:11 ` Sean Christopherson
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=ZyUMlFSjNTJdQpU6@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