cpu-partitioning: added initrd generation dracut/systemd workarounds

resolves: RHEL-120175
This commit is contained in:
Jaroslav Škarvada 2025-10-20 17:08:54 +02:00
parent d5cc96afff
commit 86ca8291e2
2 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,68 @@
From 8889fbb65a2fef367811dbbf97aaa77afcc59d09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Wed, 8 Oct 2025 19:29:41 +0200
Subject: [PATCH] cpu-partitioning: autodetect dracut hook directory,
workaround for systemd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Wrong hook directory can make the machine unbootable:
https://issues.redhat.com/browse/RHEL-119889
Also added workaround for currently non-functional systemd plugin
which doesn't include the systemd config into the initrd image.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
---
profiles/cpu-partitioning/script.sh | 13 +++++++++++--
profiles/cpu-partitioning/tuned.conf | 3 ++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/profiles/cpu-partitioning/script.sh b/profiles/cpu-partitioning/script.sh
index ec422ca..5fe8d7d 100755
--- a/profiles/cpu-partitioning/script.sh
+++ b/profiles/cpu-partitioning/script.sh
@@ -3,10 +3,19 @@
. /usr/lib/tuned/functions
start() {
+ DRACUT_VER=`dracut --version | sed 's/^.* \([0-9]\+\).*/\1/'`
+ echo "$DRACUT_VER" | grep -q '^[[:digit:]]\+$' || DRACUT_VER="0"
+ # https://issues.redhat.com/browse/RHEL-119889
+ if [ "$DRACUT_VER" -gt "102" ]
+ then
+ DRACUT_HOOK_DIR="/var/lib/dracut/hooks/pre-udev"
+ else
+ DRACUT_HOOK_DIR="/usr/lib/dracut/hooks/pre-udev"
+ fi
mkdir -p "${TUNED_tmpdir}/etc/systemd"
- mkdir -p "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev"
+ mkdir -p "${TUNED_tmpdir}${DRACUT_HOOK_DIR}"
cp /etc/systemd/system.conf "${TUNED_tmpdir}/etc/systemd/"
- cp 00-tuned-pre-udev.sh "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev/"
+ cp 00-tuned-pre-udev.sh "${TUNED_tmpdir}${DRACUT_HOOK_DIR}"
setup_kvm_mod_low_latency
disable_ksm
return "$?"
diff --git a/profiles/cpu-partitioning/tuned.conf b/profiles/cpu-partitioning/tuned.conf
index 11f03cf..e795dcb 100644
--- a/profiles/cpu-partitioning/tuned.conf
+++ b/profiles/cpu-partitioning/tuned.conf
@@ -23,6 +23,7 @@ tmpdir=${f:strip:${f:exec:mktemp:-d}}
isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}}
isolated_cpumask=${f:cpulist2hex:${isolated_cores_expanded}}
not_isolated_cores_expanded=${f:cpulist_invert:${isolated_cores_expanded}}
+not_isolated_cores=${f:cpulist_pack:${not_isolated_cores_expanded}}
isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}}
not_isolated_cores_online_expanded=${f:cpulist_online:${not_isolated_cores_expanded}}
not_isolated_cpumask=${f:cpulist2hex:${not_isolated_cores_expanded}}
@@ -62,4 +63,4 @@ priority=10
initrd_remove_dir=True
initrd_dst_img=tuned-initrd.img
initrd_add_dir=${tmpdir}
-cmdline_cpu_part=+nohz=on${cmd_isolcpus} nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} tuned.non_isolcpus=${not_isolated_cpumask} intel_pstate=disable nosoftlockup
+cmdline_cpu_part=+nohz=on${cmd_isolcpus} nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} tuned.non_isolcpus=${not_isolated_cpumask} systemd.cpu_affinity=${not_isolated_cores} intel_pstate=disable nosoftlockup
--
2.51.0

View File

@ -43,7 +43,7 @@
Summary: A dynamic adaptive system tuning daemon
Name: tuned
Version: 2.26.0
Release: 1%{?prerel1}%{?dist}
Release: 1%{?prerel1}%{?dist}.1
License: GPL-2.0-or-later AND CC-BY-SA-3.0
Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}/%{name}-%{version}%{?prerel2}.tar.gz
# RHEL-9 specific recommend.conf:
@ -118,6 +118,8 @@ Recommends: subscription-manager
Requires: python3-syspurpose
%endif
%endif
# https://github.com/redhat-performance/tuned/pull/805
Patch: tuned-2.26.0-cpu-partitioning-initrd-workaround.patch
%description
The tuned package contains a daemon that tunes system settings dynamically.
@ -635,6 +637,10 @@ fi
%config(noreplace) %{_sysconfdir}/tuned/ppd.conf
%changelog
* Mon Oct 20 2025 Jaroslav Škarvada <jskarvad@redhat.com> - 2.26.0-1.1
- cpu-partitioning: added initrd generation dracut/systemd workarounds
resolves: RHEL-120175
* Mon Aug 25 2025 Jaroslav Škarvada <jskarvad@redhat.com> - 2.26.0-1
- new release
- rebased tuned to latest upstream