From: Sean Christopherson <seanjc@google.com>
To: Tejun Heo <tj@kernel.org>
Cc: "Michal Koutný" <mkoutny@suse.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Luca Boccassi" <bluca@debian.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
kvm@vger.kernel.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: cgroup2 freezer and kvm_vm_worker_thread()
Date: Thu, 7 Nov 2024 12:48:14 -0800 [thread overview]
Message-ID: <Zy0njoaJGS9310eR@google.com> (raw)
In-Reply-To: <Zy0M9yv7xIiKB_Xi@slm.duckdns.org>
On Thu, Nov 07, 2024, Tejun Heo wrote:
> Hello,
>
> On Thu, Nov 07, 2024 at 07:05:46PM +0100, Michal Koutný wrote:
> ...
> > I'd first ask why the kvm_vm_worker_thread needs to be in the KVM task's
> > cgroup (and copy its priority at creation time but no later adjustments)?
> >
> > If it can remain inside root cgroup (like any other good kthread) its
> > job may be even chunked into periodic/deferred workqueue pieces with no
> > kthread per KVM at all.
>
> That'd be better but I suppose kvm wants them in the same cgroup for a
> reason.
Yes. The one and only user of kvm_vm_create_worker_thread() does non-trivial
work on behalf of the VM, and so we want all of the CPU time consumed by that
work to be charged to the VM's container, e.g. so that a VM that is generating
a lot of work doesn't negatively impact other VMs on the same host (the amount
of work done is directly affected by how the guest is accessing its memory).
prev parent reply other threads:[~2024-11-07 20:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 0:07 cgroup2 freezer and kvm_vm_worker_thread() Tejun Heo
2024-10-29 20:46 ` Roman Gushchin
2024-10-29 22:59 ` Paolo Bonzini
2024-10-30 0:25 ` Tejun Heo
2024-10-30 0:38 ` Luca Boccassi
2024-10-30 12:05 ` Paolo Bonzini
2024-10-30 18:14 ` Tejun Heo
2024-11-06 23:21 ` Luca Boccassi
2024-11-06 23:22 ` Paolo Bonzini
2024-11-07 18:05 ` Michal Koutný
2024-11-07 18:54 ` Tejun Heo
2024-11-07 20:48 ` 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=Zy0njoaJGS9310eR@google.com \
--to=seanjc@google.com \
--cc=bluca@debian.org \
--cc=cgroups@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=pbonzini@redhat.com \
--cc=roman.gushchin@linux.dev \
--cc=tj@kernel.org \
/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