This is a minimal viable implementation of a post-loaded profile
feature. It was implemented to satisfy the needs of the
kernel_settings Ansible role.
https://github.com/linux-system-roles/kernel_settings
This feature allows us to apply a profile in a way that is
somewhat separate from the way profiles from the active_profile file
are applied. Namely, the post-loaded profile is always applied after
all the profiles from the active_profile (or more precisely, the
post-loaded profile is always put to the tail of the profile chain
when merging). Also, the post-loaded profile setting is not affected
by running 'tuned-adm profile <some profile>' - the post-loaded
profile remains applied.
The name of the post-loaded profile is stored in
/etc/tuned/post_loaded_profile.
The lack of support for multiple post-loaded profiles was more or less
an arbitrary decision. There are no problems with it, as far as I can
see. However, there is currently no use case for multiple post-loaded
profiles, so I decided to make things easier for our future selves -
it's one less thing to worry about if we need to make changes to the
profile loading logic. We can add support for multiple post-loaded
profiles anytime.
A number of other design decisions went into the
implementation. They are listed here:
https://github.com/redhat-performance/tuned/pull/272
Resolves: rhbz#1798183
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Currently the 92-tuned.install kernel-install plugin adds the tuned params
to the BLS config files in s390x machines. But the zipl bootloader doesn't
have support for variables, which leads to cmdlines like the following:
root=/dev/mapper/rhel-root crashkernel=auto rd.dasd=0.0.541f rd.dasd=0.0.551f
rd.dasd=0.0.561f rd.dasd=0.0.571f rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap
cio_ignore=all,!condev rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portno=0
$tuned_params BOOT_IMAGE=0
Don't modify the BLS snippet since the zipl bootloader doesn't support the
variables and just make the script to exit if the architecture is s390x.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
There can be lower number of arguments than the max limit.
Also fixed definition of functions which wrongly used the API.
I.e. it should work this way:
# exactly 3 arguments
__init__("FUNC", 3, 3)
# max 4 arguments, min 3 arguments (3 - 4 arguments)
__init__("FUNC", 4, 3)
# max 3 arguments (0 - 3 arguments)
__init__("FUNC", 3)
# min 3 arguments (3 - infinity arguments)
__init__("FUNC", 0, 3)
# arbitrary number of arguments (0 - infinity arguments)
__init__("FUNC", 0)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
Currently when grub.cfg file is not found, the [bootloader] plugin still
modifies /etc/tuned/bootcmdline file. However, during rollbacks, the settings
applied to that file are not rolled back. This becomes a problem in
(containerized) environments when grub.cfg file does not exist. This patch
will make the behaviour more consistent and unapply the settings in
/etc/tuned/bootcmdline even when no grub.cfg is found.
Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
'tuned-adm profile' accepts more than one profile. Document it in the
man page.
Resolves: rhbz#1794337
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
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>
Intel's new Speed Select Technology (SST) is a process power management
technology introduced by Intel that allows for throughput and per-core
performance configurations and optimizations such as allowing for
prioritization of workloads on specific cores by sacrificing performance
on other cores.
Intel has released several CascadeLake processors, commonly referred to
as CascadeLake-N, with this technology and will introduce further SST
related technologies in the next few years.
These new technologies require the disabling of the intel-pstate driver
configuration in tuned as it may interfere with the user chosen per-core
configurations of SST.
Add a new SST profile to tuned for general use.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Joe Mario <jmario@redhat.com>
Update sysctl tunings in the latency-performance profile based on
feedback from the performance team.
Resolves: rhbz#1779759
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>