After application of this patch in order to get rid of the duplicated
kernel command line options (which was duplicated due to the usage of
the grub2-mkconfig), the grub2-mkconfig needs to be run again.
We do not run it automatically in the spec file %post not to break
users not using grub2-mkconfig.
This fix expects that user has not modified the line containing the
GRUB_CMDLINE_LINUX_DEFAULT option and the $tuned_params in the
/etc/default/grub file. If user modified this line, the option
duplication may still occure. In such case, please remove the
$tuned_params from the /etc/default/grub by hand.
Resolves: rhbz#1777874
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
For perf events mmapped buffer is used. Under heavy load the buffer may
overflow. In such cases the `scheduler` plugin may start missing events
and not process some newly created processes. Increasing the buffer size
may help.
The buffer size can be set with the `perf_mmap_pages` parameter.
Value of this parameter has to be power of 2. If it is not the power of 2,
the nearest bigger power of 2 value is calculated from it and this
calculated value is used. If the `perf_mmap_pages` parameter is omitted,
the default kernel value is used, which should be 128 for the recent
kernels (tested on kernel-5.9.8).
Example:
[scheduler]
perf_mmap_pages = 256
Resolves: rhbz#1890219
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Scheduler plugin uses perf event loop to catch newly created processes.
By default it listens to perf.RECORD_COMM and perf.RECORD_EXIT events.
By setting `perf_process_fork` parameter to `true` it will also listen
to perf.RECORD_FORK events, i.e. it will explicitly process
child processes created by the fork system call. Usually, child processes
inherit affinity from their parents, thus the `scheduler` plugin doesn't
need to explicitly process them, that's why the `perf_process_fork`
parameter is by default set to `false` and child processes aren't
explicitly processed. This default setting may also save some CPU time.
Resolves: rhbz#1894610
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Currently the 92-tuned.install kernel-install plugin modifies all
BLS snippets that match the KERNEL_INSTALL_MACHINE_ID passed to
the script.
This makes sense for the system managed entries but it conflicts
with entries that are managed by the boom boot manager: boom will
propagate these options if they are present when the entry is set
up, but the files should not be modified outside boom's control
since this will cause the boom boot identifier to change.
Boom boot entries include the boot_id in the file name pattern:
%{machine_id}-%{boot_id}-%{version}.conf
Compared to the system managed entries which use:
%{machine_id}-%{version}.conf
Modify 92-tuned.install to skip this change for files that match
the boom naming convention.
Rather than rely on the presence of '-' (which may appear in some
kernel builds, especially custom or debug kernels), use a regular
expression to match the 7-character or greater SHA1 hash that
appears in boom BLS snippet file names and the remaining structure
of the file name.
A paired change is made to the tuned.spec %postun script to apply
the same scope to the logic that reverts these changes on removal.
This gives the correct behaviour for me of continuing to add the
$tuned_... references to the system managed entries where needed,
but without causing unexpected changes to the boom boot entries.
The spec file also correctly reverts the change for the same set
of entries when %postun is executed.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
The option 'default_irq_smp_affinity' affects what will be written to the
/proc/irq/default_smp_affinity. The option supports the following values:
calc:
Content of the /proc/irq/default_smp_affinity will be calculated from
the 'isolated_cores'. Non-isolated cores are calculated as an inversion
of the 'isolated_cores'. Then the intersection of the non-isolated cores
and the previous content of the /proc/irq/default_smp_affinity is
written to the /proc/irq/default_smp_affinity. If the intersection is
empty set, then just the non-isolated cores are written to the
/proc/irq/default_smp_affinity. This behavior is the default if
option 'default_irq_smp_affinity' is not specified.
ignore:
The /proc/irq/default_smp_affinity is not touched by Tuned.
cpulist like e.g. '1,3-4':
The cpulist is unpacked and directly written to the
/proc/irq/default_smp_affinity
Examples:
[scheduler]
isolated_cores = 1, 2
default_irq_smp_affinity = calc
[scheduler]
isolated_cores = 1, 2
default_irq_smp_affinity = ignore
[scheduler]
isolated_cores = 1, 3
default_irq_smp_affinity = 2, 4
Resolves: rhbz#1896348
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The service plugin can handle sysvinit, sysv-rc, openrc, systemd.
Syntax is the following:
[service]
service.sendmail = start,enable,file:${i:PROFILE_DIR}/tuned-sendmail.conf
'start' means to start the service, 'stop' to stop, 'enable' to enable,
'disable' to disable, file:FILE is the overlay configuration file
that will be installed for the service. Multiple directives can be
separated by comma ',' or semicolon ';'. If the directives are
conflicting, the last one will be used. The internal variable
${i:PROFILE_DIR} points to the directory from which the profile is
loaded.
The service plugin supports configuration overlays only for the systemd,
for other init systems this directive is ignored. The configuration
overlay files are copied to the /etc/systemd/system/SERVICE_NAME.service.d/
directories. Upon unloading if the directory is empty, it's removed.
With systemd, the 'start' directive is implemented by 'restart' in order
to allow loading of the service configuration file overlay.
With init systems other than systemd, it works only with the current runlevel.
Resolves: rhbz#1869991
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Like the cpu-partitioning profile, exclude all 'pmd' threads
to avoid repinning ovs-vswitchd pmds.
Resolves: rhbz#1861767
Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
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).
Thanks to Jiri Mencak for porting the C code to Python.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Without LAPIC tuning we do not need qemu-kvm-tools-rhev and
tuned-profiles-nfv-host-bin requirements.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The LAPIC advancement improvement is minimal (3 or 4 us) and its
calculation has shown to be problematic under certain
scenarios (for example if qemu-kvm is not installed).
Remove it.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
E.g. Ubuntu uses /bin/mktemp, while e.g. Fedora uses /usr/bin/mktemp.
There is probably no need to hardcode the path, so rely on the system path.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
It turned out that disablement of the numa_balancing could result in
upto 20% performance drop on some loads.
Related: rhbz#1746957
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Fixes#232
sysfs exports virtual dmi device structs which provides chassis type in numeric form, it should be available in all RHEL6+, so I used it as primary source (not much overhead).
If for some reasons it couldn't be read, dmidecode output will be parsed instead. Removed any references to python-dmidecode module.
chassis type is gathered only once, and only one intance of ProfileRecommender will be created (in daemon).
Signed-off-by: Michal Bajer <outSH@users.noreply.github.com>
Fix whitespace and other minor issues in solution for #232
Signed-off-by: Michal Bajer <outSH@users.noreply.github.com>