]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu, ch: Move threads to cgroup dir before changing parameters
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 14 Apr 2023 10:08:59 +0000 (12:08 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 20 Apr 2023 10:39:49 +0000 (12:39 +0200)
commit383caddea103eaab7bb495ec446b43748677f749
tree6b387321f6ec9a881c0718c648bc6a6cd4bbb2a7
parentd2af152d1fb5560bc7c9ad94c1c93179d62f9270
qemu, ch: Move threads to cgroup dir before changing parameters

With cgroupv2 this has better effect on the resource allocation.  An
excerpt from Documentation/admin-guide/cgroup-v2.rst explains is this
way:

  Migrating a process across cgroups is a relatively expensive operation
  and stateful resources such as memory are not moved together with the
  process.  This is an explicit design decision as there often exist
  inherent trade-offs between migration and various hot paths in terms
  of synchronization cost.

  [...]

  Setting a non-empty value to "cpuset.mems" causes memory of
  tasks within the cgroup to be migrated to the designated nodes if
  they are currently using memory outside of the designated nodes.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/ch/ch_process.c
src/qemu/qemu_process.c