1
0
Fork 0
Commit graph

100 commits

Author SHA1 Message Date
Jaroslav Škarvada
af56ac35ed
cpu-partitioning: used tuned instead of tuna for cores isolation
Resolves: rhbz#1442229

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-04-28 16:26:12 +02:00
Jaroslav Škarvada
8c34b7384e
builtin functions: add strip
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>
2017-04-13 23:23:58 +02:00
Jaroslav Škarvada
8cde3e1b3c
cpu-partitioning: use tuna for cores isolation
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>
2017-04-13 21:51:46 +02:00
Jaroslav Škarvada
ac78f90c77
scheduler: added support for cores isolation
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>
2017-04-07 17:46:32 +02:00
Jaroslav Škarvada
b2cc6189f8
profiles: consolidated summaries
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-04-03 22:52:18 +02:00
Jaroslav Škarvada
df9aa2f5c4
With systemd don't do full rollback on shutdown / reboot
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>
2017-04-01 12:36:43 +02:00
Jaroslav Škarvada
a952845bf1
desktop: fixed typo in profile summary
Resolves: rhbz#1421238

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-30 17:00:26 +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
Jaroslav Škarvada
3ca7cfceb1
realtime-virtual-host: accommodate new ktimersoftd thread
Patch provided by Luiz Capitulino <lcapitulino@redhat.com>

Resolves: rhbz# 1332563

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-21 10:43:58 +01: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
5e9c3d264f
cpu-partitioning: minor indentation fix
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-07 17:37:25 +01:00
Jaroslav Škarvada
6906738603
cpu-partitioning: kernel cmdline parameter changed to tuned.non_isolcpus
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>
2017-03-07 15:30:56 +01:00
Jaroslav Škarvada
64decfe756 cpu-partitioning: set workqueue affinity early
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>
2017-03-03 19:01:48 +01:00
Jaroslav Škarvada
843dc8cf5f cpu-partitioning: set CPUAffinity early in initrd image
Resolves: rhbz#1394965

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 18:28:32 +01:00
Luiz Capitulino
efd686427c cpu-partitioning: disable kvmclock sync and ple
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>
2017-01-10 13:56:56 +01:00
Luiz Capitulino
e25fcb3164 realtime-virtual-host: use kvm modprobe helpers
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2017-01-10 13:50:03 +01:00
Luiz Capitulino
e153bf3ba1 profiles/functions: introduce kvm modprobe file helpers
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>
2017-01-10 13:47:50 +01:00
Luiz Capitulino
11686d59fe cpu-partitioning: enable timer migration
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>
2017-01-10 13:44:28 +01:00
Jaroslav Škarvada
0ce452fc2e functions: used sysfs for governor switching by default
Patching of cpuspeed kept for backward compatibility.

Related: rhbz#1313489

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-11-29 16:51:37 +01:00
Jaroslav Škarvada
bac41784a3 cpu-partitioning: removed spurious whitespace
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-10-07 12:29:37 +02:00
Jaroslav Škarvada
db6947da2f profiles: added new profile cpu-partitioning
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>
2016-10-07 11:56:57 +02:00
Jaroslav Škarvada
5b9cf627f1 sap-hana: explicitly setting kernel.numa_balancing = 0 for better performance
Resolves: rhbz#1355768

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-12 16:49:10 +02: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
Jaroslav Škarvada
2d89b31cf9 realtime-virtual-host/guest: added rcu_nocbs kernel boot parameter
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>
2016-06-15 15:56:26 +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
52f2cc4ad7 atomic: increase number of inotify watches
Resolves: rhbz#1322001

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-03-29 23:48:49 +02:00
Luiz Capitulino
de021288a5 realtime-virtual-host: don't delete modprobe file on start()
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(-)
2016-01-11 11:13:08 +01:00
Jaroslav Škarvada
671cd73a57 plugin_script: stop action gets hint why it is called
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>
2016-01-08 18:29:52 +01: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
cb826c1e38 profiles: fixed lapic_timer_adv_ns cache
Patch provided by Luiz Capitulino <lcapitulino@redhat.com>

Resolves: rhbz#1259452

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-11-16 17:27:18 +01:00
Jaroslav Škarvada
9aeb585a63 profiles: Added nohz_full and nohz=on to realtime guest/host profiles
Resolves: rhbz#1274445

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-10-29 16:13:50 +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
239fb78992 functions: fixed restore_logs_syncing to preserve SELinux context on rsyslog.conf
Resolves: rhbz#1268901

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-10-06 11:42:46 +02:00
Marcelo Tosatti
874762b4c0 tuned-profiles-nfv: fix find-lapictscdeadline-optimal.sh for CPUS where ns > 6500
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
2015-10-02 12:03:31 +02:00
Jaroslav Škarvada
b6ad363186 plugins: added scsi_host plugin
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>
2015-08-24 16:16:28 +02:00
Jaroslav Škarvada
04c5222abc functions: fixed sysfs save to work with options
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>
2015-08-21 16:33:19 +02:00
Jaroslav Škarvada
bd6db76cd1 profiles-nfv: fixed dependency and paths to tscdeadline_latency.flat
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-07-24 11:09:35 +02:00
Jaroslav Škarvada
b01eaf27d1 profiles: added realtime-virtual-guest/host profiles
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>
2015-07-01 16:58:06 +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
e2f86d412f plugin_vm: do not set transparent_hugepages if overridden in kernel boot cmdline
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>
2015-06-26 13:48:01 +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