]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Add support for overriding max threads per process limit
authorJim Fehlig <jfehlig@suse.com>
Wed, 22 May 2019 23:12:14 +0000 (17:12 -0600)
committerJim Fehlig <jfehlig@suse.com>
Wed, 24 Jul 2019 21:59:49 +0000 (15:59 -0600)
commitd5572f62e329930d0533f5221839724e4fdeeb33
tree8b690ca9be3093af139936079e77f0c64aff0222
parent4837328d684a62b307f04b684df19c011e657c25
qemu: Add support for overriding max threads per process limit

Some VM configurations may result in a large number of threads created by
the associated qemu process which can exceed the system default limit. The
maximum number of threads allowed per process is controlled by the pids
cgroup controller and is set to 16k when creating VMs with systemd's
machined service. The maximum number of threads per process is recorded
in the pids.max file under the machine's pids controller cgroup hierarchy,
e.g.

$cgrp-mnt/pids/machine.slice/machine-qemu\\x2d1\\x2dtest.scope/pids.max

Maximum threads per process is controlled with the TasksMax property of
the systemd scope for the machine. This patch adds an option to qemu.conf
which can be used to override the maximum number of threads allowed per
qemu process. If the value of option is greater than zero, it will be set
in the TasksMax property of the machine's scope after creating the machine.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
12 files changed:
src/lxc/lxc_cgroup.c
src/qemu/libvirtd_qemu.aug
src/qemu/qemu.conf
src/qemu/qemu_cgroup.c
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
src/qemu/test_libvirtd_qemu.aug.in
src/util/vircgroup.c
src/util/vircgroup.h
src/util/virsystemd.c
src/util/virsystemd.h
tests/virsystemdtest.c