The strip functions makes string from all arguments and
expands to its stripped version.
Also used in the cpu-partitioning profile to strip output
of the 'mktemp -d' command.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Users can switch to Tuned if they need process blacklisting
(i.e. marking of processes which are allowed to run on
isolated cores). This will be very probably made the default
in next Tuned release.
Related: rhbz#1403309
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Plugin scheduler now can do cores isolation on its own, Tuna is
not needed for it, e.g.:
[scheduler]
isolated_cores=2-4
ps_blacklist=.*pmd.*;.*PMD.*;^DPDK;.*qemu-kvm.*
It will isolate cores 2-4, it will ignore processes which matched
ps_blacklist regexes. Multiple regexes can be separated by ';'.
Quoted semicolon, i.e. '\;' is taken literally.
It also supports 'ps_whitelist' which is by default set to '.*'.
It takes all processes which matches ps_whitelist than it removes
those which matches ps_blacklist and move them out of the
isolated_cores. When the profile is unloaded it allows all matching
processes to run on all cores.
It changes processes affinities, threads affinities, IRQs affinities
and it sets default_smp_affinity for IRQs.
Also cpu-partitioning profile has been switched from Tuna to this
mechanism.
Resolves: rhbz#1403309
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
With systemd full rollback is done if Tuned is terminated by user or profile
is changed. It is not done if Tuned is terminated due to system
shutdown / reboot. Without systemd full rollback is done only if profile
is changed.
Renamed profile_switch parameter to full_rollback where appropriate.
Also fixed various checks for command not found.
Resolves: rhbz#1421286
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
It's more descriptive to use 'tuned.non_isolcpus' kernel boot command line
parameter for dracut preudev scripts provided by Tuned than the
previously used 'tuned.cpumask'.
Related: rhbz#1395899
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This adds 00-tuned-pre-udev.sh script into initrd image which is getting
tuned.cpumask kernel command line parameter and sets workqueue affinity
accordingly.
Resolves: rhbz#1395899
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Otherwise, a process running on isolated CPUs will be
interrupted by timers or unwanted VM exists.
Resolves: rhbz#1395855
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit introduces functions to create and delete the
kvm modprobe file used by the realtime profiles.
This is needed because the cpu-partitioning profile wants
the same modprobe file for kvm.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
As the cpu-partitioning profile does not use isolcpus=,
the kernel can end up creating long living timers on
nohz_full CPUs during early boot. Those timers will
fire later, causing jitter.
However, recent Linux kernel will always try to migrate
unpinned timers away from nohz_full CPUs when timer
migration is enabled which is what we want.
NOTE: Older kernels would migrate unpinned timers from
idle CPUs to busy CPUs without regard if the
CPU is nohz_full. This would certainly cause
trouble to applications that takes 100% of the
CPU in user-space (eg. DPDK). So, enabling
timer migration is only safe on recent kernels.
Resolves: rhbz#1408308
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
The profile is delivered in the new tuned-profiles-cpu-partitioning subpackage.
Also moved defirqaffinity.py to the base package to allow other profiles
to use it.
Resolves: rhbz#1359956
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
This doesn't have effect on kernels build with CONFIG_RCU_NOCB_CPU_ALL=y.
Resolves: rhbz#1334479
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
We create the /etc/modprobe.d/kvm.rt.tuned.conf file at
every boot. However, there's nothing that guarantees that
the kvm module will be loaded after tuned. Indeed, it's
possible to reproduce a race where the kvm module is loaded
before tuned. When this happens, the kvm module will be
loaded with incorrect parameters as the kvm.rt.tuned.conf
file doesn't exist.
The solution to this problem is to create the kvm.rt.tuned.conf
file only if it doesn't exist and delete it when changing
profiles.
Resolves: rhbz#1292117
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
profiles/realtime-virtual-host/script.sh | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
Upon stop action the script is called the following way:
script.sh stop [$HINT]
$HINT is not used if the stop is result of tuned
shutdown. $HINT is set to "profile_switch" if the stop is
result of profile switch.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
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>
If the result of lapic-tsc-deadline kvm-unit-test continues
to decrease as ns increases, then use highest ns value.
Reported and tested by Luiz and Hai.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Resolves: rhbz#1267284
This plugin handles SCSI hosts. On Linux these are also used for SATA.
Currently it only supports ALPM setting, e.g.:
[scsi_host]
devices=host0
alpm=medium_power
ALPM is set per SATA/SCSI host. If SCSI host doesn't support ALPM
(it is SATA/AHCI specific), it is skipped and message is logged into
Tuned log with 'info' loglevel.
Concurrently the ALPM settings were removed from the 'disk' plugin.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
E.g.:
$ cat /sys/block/sda/queue/scheduler
noop [deadline] cfq
The 'save_sys' function needs to save 'deadline', not 'noop [deadline] cfq'.
Resolves: rhbz#1251507
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Profiles shipped in tuned-profiles-nfv subpackage. The content was provided
by Jeremy Eder <jeder@redhat.com> and Clark Williams <williams@redhat.com>.
Resolves: rhbz#1228803
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Also removed transparent_hugepages from throughput-performance profile.
Added support for 'madvise' setting of transparent_hugepages.
Resolves: rhbz#1189868
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>