1
0
Fork 0
Commit graph

44 commits

Author SHA1 Message Date
Pavol Žáčik
1ba98b652e
realtime: Disable appropriate P-State drivers
I.e., intel_pstate, amd_pstate or none.

Resolves: RHEL-85637
2025-04-16 15:09:10 +02:00
Adriaan Schmidt
c690b5ec3e realtime: remove leftover use of tuna
Before the `scheduler` plugin, `tuna` was used for CPU isolation.
There is a leftover use in the verification of the `realtime` profile.
Removing that, the dependency on the `tuna` package, and now-empty
scripts from the realtime profiles.

closes #594

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
2024-07-25 17:17:43 +02:00
Luiz Capitulino
793e6c8319 profiles: Improve 'isolated_cores=' help text
Just explain what isolated_cores= is for and recommend to only have one
isolated_cores= line to avoid wrong system configuration.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2023-11-28 11:15:47 +01:00
Marcelo Tosatti
3747701d1c move rtentsk to network-latency profile
The interruptions avoided by the rtentsk logic:

"Add plugin to open a socket with SOF_TIMESTAMPING_OPT_TX_SWHW.

This is for avoiding interruptions due to static key IPIs due
to opening socket with timestamping enabled (by opening a
socket ourselves the static key is kept enabled)."

Are also desired on systems that use cpu-partitioning.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2023-06-20 14:15:42 -03:00
Marcelo Tosatti
c9c81093be move "tsc=reliable" setting from realtime to network-latency tuned configuration
Commit 49cc817871
("realtime: Set tsc as 'reliable'") reads:

"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."

The timer is also undesired interruption to systems that use cpu-partitioning.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2023-06-20 14:15:42 -03:00
Marcelo Tosatti
4a622d2b5f unify common sysctl settings between realtime and cpu-partitioning profiles
The following sysctl settings are the same between cpu-partitioning and
realtime profiles:

kernel.hung_task_timeout_secs = 600
kernel.nmi_watchdog = 0
vm.stat_interval = 10
kernel.timer_migration = 0

Unify them in the network-latency profile, parent of both profiles.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2023-06-20 14:15:42 -03:00
Evgeni Golov
3854797abb explicitly use /bin/bash for tuned scripts 2023-02-19 15:23:12 +01:00
Jaroslav Škarvada
39e6d14bdf
builtin functions: added calc_isolated_cores function
The calc_isolated_cores function expands to the list of cores to
isolate. It accepts optional argument which specifies how many cores
from each socket reserve for housekeeping. If not specified, one core
from each socket is reserved for housekeeping.

Example:
Machine with 2 sockets, each 4 cores, using the following user variable
configuration file, e.g. /etc/tuned/realtime-variables.conf:
isolated_cores=${f:calc_isolated_cores:2}

It will expand to:
isolated_cores=2, 3, 6, 7

I.e. cores 0, 1 and 4, 5 will be used for housekeeping.

Also updated the TuneD profiles to use this builtin function for
isolated_cores preset.

Resolves: rhbz#2093847

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2022-08-09 13:51:45 +02:00
Nicolas Saenz Julienne
49cc817871 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 <nsaenzju@redhat.com>
2022-03-29 18:45:21 +02:00
P J P
dc8bdeff55 profiles: enable isolate_managed_irq by default
Enable 'isolate_managed_irq' parameter by default. It is important
for -realtime systems. When it is enabled, kernel directs interrupts
to the housekeeping CPUs and thus reduces latencies for the isolated
ones.

Fixes: RHBZ#1820626
2021-06-07 18:28:52 +05:30
Jaroslav Škarvada
01fecec1d1
Merge pull request #344 from yarda/rhbz1957897
cpu-partitioning,realtime: set cpumasks of all workqueues
2021-05-20 10:59:25 +02:00
P J P
6407ca44c6 profiles: improve realtime verify functions
tuned(8) realtime-virtual-{host|guest} profiles set Kernel and
KVM module parameters via script.sh plugin. These parameters are
to be verified in a verify() function, invoked by tuned-adm verify
command.

This patch updates verify() functions to validate KVM module
parameters.

It moves kernel parameters to the tuned.conf file under the
[sysfs] & [sysctl] plugin sections. And removes call to
disable_ksm function, no longer required.

Fixes: RHBZ#1947858
2021-05-13 15:21:48 +05:30
Jaroslav Škarvada
38f7e63611
cpu-partitioning,realtime: set cpumasks of all workqueues
Related: rhbz#1957897

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-05-12 21:17:27 +02:00
Nitesh Narayan Lal
c002d93b59 realtime: added support for netdev_queue_count
This allows the user to adjust the queue count for each
network device.

Also add check_net_queue_count built-in function.

The functions check if the user has specified any
queue count value or not. If no value is passed the function
returns the number of housekeeping CPUs as the queue count.

Resolves: rhbz#1846767

Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
2021-01-22 11:55:39 -05:00
Marcelo Tosatti
8aef56287b realtime profile: use rtentsk plugin
Use rt-entsk tuned plugin and drop systemctl service usage.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2020-07-28 12:48:29 +02:00
Ondřej Lysoněk
0509247f8b realtime: Use the irqbalance plugin
Use the new irqbalance plugin instead of a script to set up
irqbalance.

I'm placing the 'irqbalance' instance before the 'script' instance so
that it's executed at the same time as the script, however I don't
think the 'irqbalance' instance needs to be ordered in any specific
way and could be placed almost anywhere.

Resolves: rhbz#1784645

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-06-05 10:23:42 +02:00
Jiri Mencak
c930eef0af Enable isolate_managed_irq to be defined in child profiles.
Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
2020-04-16 14:09:55 +02:00
Jaroslav Škarvada
5ed61ce394
realtime: added conditional support for managed_irq
Also added regex_search_ternary built-in function.

It takes arguments in the following form:
  STR1, REGEX, STR2, STR3

If REGEX matches STR1 (re.search is used), STR2 is returned,
if it doesn't match STR3 is returned.

Example:
[variables]
foo=Y
bar=${f:regex_search_ternary:${foo}:\b[y,Y,1,t,T]\b:foo:bar}

It will result in the 'foo' string stored in the '${bar}' variable.

Resolves: rhbz#1797025

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-03-23 14:43:47 +01:00
Ondřej Lysoněk
0eb0c6bc7f profiles: Make sure variables are defined before use
Make sure the isolated_cores and no_balance_cores variables are
defined before any of the variables that use them are defined. This
enforces a certain ordering of variable expansions so that child
profiles can set the variables directly in the profile (tuned.conf),
e.g.:

[main]
include=cpu-partitioning

[variables]
isolated_cores=3

Resolves: rhbz#1781664

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-01-06 15:50:06 +01:00
Marcelo Tosatti
785128af2d realtime profile: fix nowatchdog kernel command line option
The correct string for the option is "tsc=nowatchdog", and
not "nowatchdog".

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2019-11-13 21:01:43 +01:00
Marcelo Tosatti
0facf2ed5e realtime profile: add "nowatchdog" kernel command line option
This option disables the TSC clocksource watchdog
for isolated CPUs (which avoids interruptions
by the per-CPU clocksource watchdog timer).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2019-11-01 11:00:28 +01:00
Peter Xu
7e93b6948f realtime: Apply irqbalance tunes too in realtime profiles
Realtime profiles require to restrict irqbalance too.  Apply them to
the realtime profile so that realtime-virtual-{host|guest} can benefit
from that too.

Signed-off-by: Peter Xu <peterx@redhat.com>
2019-07-10 13:09:03 +08:00
Jaroslav Škarvada
1cce9d79e9
Use online CPUs for cpusets calculations instead of present CPUs
resolves: rhbz#1613478

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2018-08-27 00:23:51 +02:00
Ondřej Lysoněk
c2dfc1f806 profiles: Replace calls to defirqaffinity.py
In the cpu-partitioning profile, IRQ affinity change is already done
as part of the 'isolated_cores' option of the scheduler plugin, so
calling defirqaffinity is, at best, redundant. So let's remove the call.

In the realtime* profiles, it's essentially the same, except that tuna
was used instead of isolated_cores. So let's use built-in functionality
instead of tuna and drop calls to defirqaffinity.

Resolves: rhbz#1590937

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-07-03 00:15:34 +02:00
Jaroslav Škarvada
643864f10c
network-latency: added skew_tick=1 kernel command line parameter
Also removed the parameter from the realtime profile, because it already
includes the network-latency profile.

Resolves: rhbz#1451073

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-07-19 13:46:56 +02:00
Luiz Capitulino
9bc020df37 realtime: use skew_tick=1 in kernel cmdline
By default the timer tick will fire at the same time on all
CPUs. This causes the jiffies_lock to get contended in the
real-time kernel, as it's a raw spinlock. skew_tick=1 causes
the timer tick to fire at different times on all CPUs,
fixing the contention.

Note skew_tick=1 usage is going to be propagated to the
NFV profiles as well.

Resolves: rhbz#1447938

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2017-05-29 17:30:17 +02:00
Luiz Capitulino
fdff5f15b9 realtime: drop unhelpful comment
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2017-05-29 17:30:15 +02:00
Jaroslav Škarvada
1a100c9c7b
profiles: fixed assert for unset isolated_cores
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-30 16:29:49 +02:00
Jaroslav Škarvada
6c3fd2b79e
profiles: added check for unset isolated_cores
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-30 16:14:06 +02:00
Jaroslav Škarvada
1623ac4a85
assertion_non_equal: improved logging for better readability
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-30 16:09:53 +02:00
Jaroslav Škarvada
d8b925ae65
realtime: fixed misleading error message if no isolated cores are set
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-30 15:07:49 +02:00
Jaroslav Škarvada
f104dca756
realtime: correctly log error message about no isolated cores set
Error message about no isolated cores set wasn't displayed,
because the current plugin_script code only logs messages written
to STDERR.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-30 13:49:35 +02:00
Ondřej Lysoněk
9e8450c8b6 Use ${i:PROFILE_DIR} in our profiles
Use the new ${i:PROFILE_DIR} internal function with the 'script'
option in the profiles we ship.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-13 09:50:26 +01:00
Jaroslav Škarvada
b85e9c2180 realtime: changed assertion text to be more clear
Related: rhbz#1264128

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-17 14:16:57 +02:00
Jaroslav Škarvada
07d63a8fb0 realtime: added assertion to check whether isolated_cores contains present CPUs
Resolves: rhbz#1264128

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-17 14:12:01 +02:00
Jaroslav Škarvada
099ae05b74 realtime: fixed kernel.sched_rt_runtime_us to be -1
kernel.sched_rt_runtime_us - a global limit on how much time realtime
scheduling may use. A run time of -1 specifies runtime == period, ie. no limit.

Resolves: rhbz#1346715

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-15 21:36:44 +02:00
Luiz Capitulino
32ef5d8db0 realtime: disable timer migration
It was found during code review that the kernel always try to
migrate timers away from idle CPUs to busy CPUs. Real-time
CPUs running dpdk polling threads for example, are busy so
they are a great candidate to receive timers from idle CPUs
(see get_nohz_timer_target() in the kernel sources).

It is not clear how this problem can affect real-time
applications and KVM-RT. However, for real-time and
high-performance the best thing is for a timer to always
fire in the CPU where it was created.

Resolves: rhbz#1323283

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2016-04-04 10:36:53 +02:00
Jaroslav Škarvada
c24e2ea0ca Added support for 'summary' and 'description' of profiles
Added new tuned-adm functionality 'profile_info'. It has optional parameter
'profile_name'. If called without parameter, active profile is used.
It outputs name of the profile it is querying, profile summary, and profile
description. If there is no profile summary or description available it
outputs empty string(s).

Extended tuned-adm 'list' functionality. It now displays profile summary
in the list (if available).

Added summary to profiles.

Extended D-Bus API to support the new feature and for better Cockpit support:
 - Added 'profile_info' method. It gets profile_name argument and it queries
   the requested profile for information. If profile_name is empty string it
   queries the active/selected profile. It returns tuple of the following
   format (status, profile_name, summary, description), where status is
   boolean. If it is False, the query mechanism failed and the other fields
   don't contain valid data
 - Added 'profiles2' method. It's extension of 'profiles' method. It returns
   list of tuples. Tuples have following format:
   (profile_name, profile_summary)

Related: rhbz#1228356
Fixes: #46

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-01-05 11:28:25 +01:00
Jaroslav Škarvada
796b4f4fd4 profiles: removed nohz_full from the realtime profile
Resolves: rhbz#1274486

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-10-29 15:23:46 +01:00
Jaroslav Škarvada
5a5986bd8b realtime: set unboud workqueues cpumask
The latest RHEL and RT kernels got support for setting the cpumask of unbound
workqueues in sysfs (https://bugzilla.redhat.com/show_bug.cgi?id=1176155).

This patch sets the unbound workqueues cpumask to the list of non-isolated
cores for the real-time profiles.

Patch from Luiz Capitulino <lcapitulino@redhat.com>

Resolves: rhbz#1259043

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-10-06 11:49:56 +02:00
Jaroslav Škarvada
7dcab8a180 realtime: minor formatting fix
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-29 16:37:21 +02:00
Jaroslav Škarvada
8ec878cb50 realtime: fixed / simplified profile according to comments
tuna now do isolation of cores (-i)

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-23 09:15:57 +02:00
Jaroslav Škarvada
740fab40ec realtime: moved variables to /etc/tuned/realtime-variables.conf
And some minor tweaks.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-22 17:32:35 +02:00
Jaroslav Škarvada
46f1968bce profiles: added realtime
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-18 17:21:09 +02:00