From 500c18046abc34d947f0a97fb3ed01573bc14f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 19 May 2022 19:14:39 +0200 Subject: [PATCH] realtime: set tsc as reliable resolves: rhbz#2086374 --- tuned-2.18.0-realtime-tsc-reliable.patch | 45 ++++++++++++++++++++++++ tuned.spec | 7 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tuned-2.18.0-realtime-tsc-reliable.patch diff --git a/tuned-2.18.0-realtime-tsc-reliable.patch b/tuned-2.18.0-realtime-tsc-reliable.patch new file mode 100644 index 0000000..a02f32a --- /dev/null +++ b/tuned-2.18.0-realtime-tsc-reliable.patch @@ -0,0 +1,45 @@ +From 49cc817871672d0a5bad138dd7ad781b684a9fd9 Mon Sep 17 00:00:00 2001 +From: Nicolas Saenz Julienne +Date: Wed, 16 Mar 2022 17:06:45 +0100 +Subject: [PATCH] realtime: Set tsc as 'reliable' + +We already disable the clocksource watchdog, it's there to double-check +whether clock results are coherent between reads. But a new reliability +test was introduced in recent kernels[1], tracking tsc drift between +CPUs[2]. It works by programming timers on all CPUs, including isolated +ones, and checks whether the tsc was adjusted in between runs. This +introduces unwarranted latency on real time systems. So let's promote +tsc to 'reliable', which disables both checks. + +There shouldn't be any impact on old nor new setups. First, this test +didn't exist in the past, so any eventual drift was left uncorrected. +Second, most telco and HPC use-cases will make heavy use of tsc in +user-space, and its reliability is already assumed in the system's +design. + +[1] c7719e793478 x86/tsc: Add a timer to make sure TSC_adjust is always + checked +[2] Generally caused by rogue BIOSes adjusting the tsc on a CPU and not + doing so on the rest + +Signed-off-by: Nicolas Saenz Julienne +--- + profiles/realtime/tuned.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/profiles/realtime/tuned.conf b/profiles/realtime/tuned.conf +index b1657af..196ed01 100644 +--- a/profiles/realtime/tuned.conf ++++ b/profiles/realtime/tuned.conf +@@ -52,7 +52,7 @@ kernel.timer_migration = 0 + /sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1 + + [bootloader] +-cmdline_realtime=+isolcpus=${managed_irq}${isolated_cores} intel_pstate=disable nosoftlockup tsc=nowatchdog ++cmdline_realtime=+isolcpus=${managed_irq}${isolated_cores} intel_pstate=disable nosoftlockup tsc=reliable + + [irqbalance] + banned_cpus=${isolated_cores} +-- +2.35.1 + diff --git a/tuned.spec b/tuned.spec index 5e21592..fe80841 100644 --- a/tuned.spec +++ b/tuned.spec @@ -35,7 +35,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.18.0 -Release: 1%{?prerel1}%{?dist} +Release: 2%{?prerel1}%{?dist} License: GPLv2+ Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}/%{name}-%{version}%{?prerel2}.tar.gz # RHEL-9 specific recommend.conf: @@ -97,6 +97,7 @@ Recommends: subscription-manager Requires: python3-syspurpose %endif %endif +Patch0: tuned-2.18.0-realtime-tsc-reliable.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -548,6 +549,10 @@ fi %{_mandir}/man7/tuned-profiles-openshift.7* %changelog +* Thu May 19 2022 Jaroslav Škarvada - 2.18.0-2 +- realtime: set tsc as reliable + resolves: rhbz#2086374 + * Wed Feb 9 2022 Jaroslav Škarvada - 2.18.0-1 - new release - rebased tuned to latest upstream