From 49cc817871672d0a5bad138dd7ad781b684a9fd9 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Wed, 16 Mar 2022 17:06:45 +0100 Subject: [PATCH 1/4] 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} From ccff8454deabec8966d5356eb2db2b64290c1a66 Mon Sep 17 00:00:00 2001 From: Jiri Mencak Date: Fri, 29 Apr 2022 11:56:22 +0200 Subject: [PATCH 2/4] openshift profile: tuning for NVMe devices AWS Nitro instances need special tuning for NVMe devices: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#timeout-nvme-ebs-volumes [sysfs] /sys/module/nvme_core/parameters/io_timeout=4294967295 /sys/module/nvme_core/parameters/max_retries=10 This tuning should probably be moved to Cloud Provider-specific profiles once the functionality is implemented. Signed-off-by: Jiri Mencak --- profiles/openshift/tuned.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/openshift/tuned.conf b/profiles/openshift/tuned.conf index 9815fb9..ec4bf1a 100644 --- a/profiles/openshift/tuned.conf +++ b/profiles/openshift/tuned.conf @@ -25,6 +25,10 @@ net.ipv6.neigh.default.gc_thresh2=32768 net.ipv6.neigh.default.gc_thresh3=65536 vm.max_map_count=262144 +[sysfs] +/sys/module/nvme_core/parameters/io_timeout=4294967295 +/sys/module/nvme_core/parameters/max_retries=10 + [scheduler] # see rhbz#1979352; exclude containers from aligning to house keeping CPUs cgroup_ps_blacklist=/kubepods\.slice/ From cc453048f5acac5b1997d8df48d6653815ae9815 Mon Sep 17 00:00:00 2001 From: Jan Zerdik Date: Mon, 9 May 2022 11:58:04 +0200 Subject: [PATCH 3/4] Adding mtu command to net plugin Resolves: rhbz#2082494 Signed-off-by: Jan Zerdik --- tuned/plugins/plugin_net.py | 47 ++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/tuned/plugins/plugin_net.py b/tuned/plugins/plugin_net.py index 145f686..f360d75 100644 --- a/tuned/plugins/plugin_net.py +++ b/tuned/plugins/plugin_net.py @@ -21,7 +21,7 @@ class NetTuningPlugin(base.Plugin): self._load_smallest = 0.05 self._level_steps = 6 self._cmd = commands() - self._re_ip_link_show_qlen = None + self._re_ip_link_show = {} self._use_ip = True def _init_devices(self): @@ -144,6 +144,7 @@ class NetTuningPlugin(base.Plugin): "ring": None, "channels": None, "txqueuelen": None, + "mtu": None, } def _init_stats_and_idle(self, instance, device): @@ -325,10 +326,13 @@ class NetTuningPlugin(base.Plugin): return None return value - def _get_re_ip_link_show_qlen(self): - if self._re_ip_link_show_qlen is None: - self._re_ip_link_show_qlen = re.compile(r".*\s+qlen\s+(\d+)") - return self._re_ip_link_show_qlen + def _get_re_ip_link_show(self, arg): + """ + Return regex for int arg value from "ip link show" command + """ + if arg not in self._re_ip_link_show: + self._re_ip_link_show[arg] = re.compile(r".*\s+%s\s+(\d+)" % arg) + return self._re_ip_link_show[arg] @command_get("txqueuelen") def _get_txqueuelen(self, device, ignore_missing=False): @@ -337,7 +341,7 @@ class NetTuningPlugin(base.Plugin): if not ignore_missing: log.info("Cannot get 'ip link show' result for txqueuelen value for device '%s'" % device) return None - res = self._get_re_ip_link_show_qlen().search(out) + res = self._get_re_ip_link_show("qlen").search(out) if res is None: # We can theoretically get device without qlen (http://linux-ip.net/gl/ip-cref/ip-cref-node17.html) if not ignore_missing: @@ -345,6 +349,37 @@ class NetTuningPlugin(base.Plugin): return None return res.group(1) + @command_set("mtu", per_device=True) + def _set_mtu(self, value, device, sim): + if value is None: + return None + try: + int(value) + except ValueError: + log.warn("mtu value '%s' is not integer" % value) + return None + if not sim: + res = self._call_ip_link(["set", "dev", device, "mtu", value]) + if res is None: + log.warn("Cannot set mtu for device '%s'" % device) + return None + return value + + @command_get("mtu") + def _get_mtu(self, device, ignore_missing=False): + out = self._ip_link_show(device) + if out is None: + if not ignore_missing: + log.info("Cannot get 'ip link show' result for mtu value for device '%s'" % device) + return None + res = self._get_re_ip_link_show("mtu").search(out) + if res is None: + # mtu value should be always present, but it's better to have a test + if not ignore_missing: + log.info("Cannot get mtu value from 'ip link show' result for device '%s'" % device) + return None + return res.group(1) + # d is dict: {parameter: value} def _check_parameters(self, context, d): if context == "features": From 9671f98af265253dc2b31960e9225d7aff212275 Mon Sep 17 00:00:00 2001 From: Vaibhav Nagare Date: Wed, 18 May 2022 17:21:42 +0530 Subject: [PATCH 4/4] tuned-adm: Add missing entries in the OPTIONS section Add missing options profile_info, auto_profile and profile mode in the OPTIONS section of the man page. Resolves: rhbz#2075774 Signed-off-by: Vaibhav Nagare --- man/tuned-adm.8 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/man/tuned-adm.8 b/man/tuned-adm.8 index ace1f16..3092403 100644 --- a/man/tuned-adm.8 +++ b/man/tuned-adm.8 @@ -24,7 +24,7 @@ tuned\-adm - command line tool for switching between different tuning profiles .SH SYNOPSIS .B tuned\-adm -.RB [ list " | " active " | " "profile \fI[profile]\fP..." " | " off " | " verify " | " recommend ] +.RB [ list " | " active " | " "profile \fI[profile]\fP..." " | " "profile_info \fI[profile]\fP..." " | " off " | " verify " | " recommend ] .SH DESCRIPTION This command line utility allows you to switch between user definable tuning @@ -71,6 +71,10 @@ profile is given, then all available profiles are listed. If the profile given is not valid, the command gracefully exits without performing any operation. +.TP +.BI "profile_info " [PROFILE_NAME] ... +Show information/description of given profile or current profile if no profile is specified. + .TP .B verify Verifies current profile against system settings. Outputs information whether @@ -96,6 +100,14 @@ name in both directories, the one from \fI/etc/tuned/recommend.d\fP is used) and the files are evaluated in alphabetical order. The first matching entry is used. +.TP +.B auto_profile +Enable automatic profile selection mode, switch to the recommended profile. + +.TP +.B profile_mode +Show current profile selection mode. + .TP .B off Unload tunings.