!410 [sync] PR-409: 手动同步PR:407

From: @openeuler-sync-bot 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
This commit is contained in:
openeuler-ci-bot 2023-06-09 01:26:00 +00:00 committed by Gitee
commit cc5c5ebf6b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From 14b69596b0bff64f7482d93ea3f043520a716921 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 8 Jun 2023 20:02:50 +0800
Subject: [PATCH] set the cpuset.cpus/mems of machine.slice to all by default
This is necessary after merging core-cgroup-support-cpuset.patch.
When creating a vm, libvirt will issue a dbus method_call to
systemd-machined. systemd-machined will start transient unit
usually named xxx.scope with Delegate=1 set after receiving
the method_call. If Delegate=1 is set, systemd will create
machine.slice in /sys/fs/cgroup for every cgroup subsystem, this
includes cpuset. cpuset is different, you can't migrate processes
to the created directory unless you have set proper cpuset.cpus
and cpuset.mems.
Without this patch, libvirt sees machine.slice, it won't check
if cpuset.cpus or cpuset.mems is valid, and just migrate the vm
process to machine.slice. This action will fail because core-cgroup
-support-cpuset.patch only supports create the machine.slice
directory when Delegate=1 is set, but won't set cpuset.cpus
and cpuset.mems automatically.
Now we have this patch, it will make systemd automatically set
cpuset.cpus and cpuset.mems according to /sys/fs/cgroup/cpuset/{
cpuset.cpus, cpuset.mems}. Then libvirt can migrate vm processes
freely.
---
units/machine.slice | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/units/machine.slice b/units/machine.slice
index 501d353..8d87851 100644
--- a/units/machine.slice
+++ b/units/machine.slice
@@ -11,3 +11,8 @@
Description=Virtual Machine and Container Slice
Documentation=man:systemd.special(7)
Before=slices.target
+
+[Slice]
+CPUSetCpus=all
+CPUSetMems=all
+CPUSetCloneChildren=1
--
2.33.0

View File

@ -21,7 +21,7 @@
Name: systemd
Url: https://www.freedesktop.org/wiki/Software/systemd
Version: 249
Release: 50
Release: 51
License: MIT and LGPLv2+ and GPLv2+
Summary: System and Service Manager
@ -543,6 +543,7 @@ Patch9053: support-disable-cgroup-controllers-we-don-t-want.patch
Patch9054: fix-mount-failed-while-daemon-reexec.patch
Patch9055: bugfix-for-cgroup-Swap-cgroup-v1-deletion-and-migration.patch
Patch9056: delete-journal-files-except-system.journal-when-jour.patch
Patch9057: set-the-cpuset.cpus-mems-of-machine.slice-to-all-by-.patch
BuildRequires: gcc, gcc-c++
BuildRequires: libcap-devel, libmount-devel, pam-devel, libselinux-devel
@ -1955,6 +1956,9 @@ fi
%{_libdir}/security/pam_systemd.so
%changelog
* Thu Jun 8 2023 licunlong <licunlong1@huawei.com> - 249-51
- set the cpuset.cpus/mems of machine.slice to all by default
* Sat Jun 3 2023 chenjiayi <chenjiayi22@huawei.com> - 249-50
- backport upstream patches to fix event loss when the whole disk is locked