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
Add and improve parameters error checking at the time of their
retrieval and setting respectively in _custom_parameters().
Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Commit 0ab1f8cc3f adds a check which replaces the channels mode parameters
based on the supported mode. With the older kernels, the un-supported mode
was indicated by 0, however recently that has been replaced by a string 'n/a'.
Due to this the check in plugin_net that verifies if a replacement is
required or not fails.
Fix the check to incorporate this new string that indicates the un-supported
mode.
Resolves: rhbz#1943291
Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
Although udev properties are sorted by libudev, according
to libudev/systemd upstream this behavior cannot be relied
upon. Sort them explicitly for consistent behavior.
Resolves: rhbz#1939970
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
plugin_net instances can now be given a new 'channels' option with
the following values (see ethtool(8) for their meaning):
rx N
tx N
other N
combined N
The syntax is the same as the syntax for 'rings', 'coalesce' and
other parameters introduced previously.
Example:
[net]
channels=combined 16
Since a network device either supports rx/tx or combined queue
mode. This patch automatically adjusts the parameters based on the
mode supported by the device as long as a valid configuration is
requested.
Resolves: rhbz#1846767
Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
The current 3600s wait() timeout in the controller's loop is too high.
There are known instances of signals not being acted upon. One known
example is SIGTERM not being acted upon during system shutdown.
Lowering the timeout to 10s allows for this signal to be acted upon right
after the timeout.
Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
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>