1
0
Fork 0
Commit graph

702 commits

Author SHA1 Message Date
Jaroslav Škarvada
fd40ca7c67 plugin_disk: try to workaround embedded '/' in device names
It seems that some drivers return udev names with embedded slashes '/', e.g.:
sfdsk/gdssys34

When kernel creates sysfs nodes for them it replaces '/' by '!' not to cause
ambiguity in path, i.e. the device from previous example will become:
sfdsk!gdssys34

This commit add support for such cases. It checks whether there is embedded
'/' in the device name, if yes, it tries to construct sysfs path with '!'.
It checks whether the resulting sysfs path exists, if not, it tries the
version with embedded '/'. This is safety fallback not to cause regression
in some weird cases and it may be dropped in the future.

Related: rhbz#1353142

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-12 11:57:11 +02:00
Jaroslav Škarvada
1d57d7229b plugin_base: correctly strip assignment modifiers even if not used
Resolves: rhbz#1353142

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-08 15:58:30 +02:00
Jaroslav Škarvada
6793c2abff plugins: added modules plugin
This plugin can set parameters to kernel modules. It generates
/etc/modprobe.d/tuned.conf file.

Usage:

[modules]
MODULE=OPTION1=VALUE1 OPTION2=VALUE2...

E.g:

[modules]
netrom=nr_ndevs=2

This sets module 'netrom' to have 'nr_ndevs' option set to '2'. The module
can be also forced to load/reload by using special '+r' prefix, e.g.:

[modules]
netrom=+r nr_ndevs=2

Will also cause Tuned to try to remove 'netrom' module (if loaded) and
try to (re)insert it with the specified parameters. The '+r' can be followed
by an optional comma (','), i.e.:
'+r,' for better readability.

By using '+r' the module will be loaded even if not needed.

Resolves: rhbz#1249618

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-04 19:03:51 +02:00
Jaroslav Škarvada
ddeadd34eb spec: fixed conditional support for grub2 to work with selinux
Resolves: rhbz#1351937

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-01 19:01:30 +02:00
Jaroslav Škarvada
6bf3afa9d3 plugin_cpu: added support for sampling_down_factor and removed cpupower
The sampling rate determines how frequently the governor checks to tune the
CPU. The sampling_down_factor is a tunable that multiplies the sampling rate
when the CPU is at its highest clock frequency thereby delaying load
evaluation and improving performance. Allowed values for
sampling_down_factor are 1 to 100000.

Usage:

[cpu]
sampling_down_factor = 1

Recommended setting for jitter reduction:
sampling_down_factor = 100

Original idea of adding support for this knob to Tuned came from
Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>

This patch also removes cpupower support from Tuned. It seems
that cpupower tool changes it's output format time to time, and parsing
it in Tuned becomes harder and harder. Morever the current parser in Tuned
didn't handle the recent cpupower correctly. It's much easier to just query
sysfs than supporting multiple versions of cpupower.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-23 11:24:41 +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
99a600b1eb functions: added assertion
This function takes three arguments:
etxt - the text to be logged if the assertion fails
var1 - first variable to compare
var2 - seconf variable to compare

The function compares 'var1' and' var2', if they don't match
it logs 'etxt' and raises exception which will abort profile
loading.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-16 18:53:24 +02:00
Jaroslav Škarvada
221c86f911 daemon: fixed traceback if there is an exception during initial profile loading
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-16 18:51:13 +02:00
Jaroslav Škarvada
f7cdad231c functions: fixed description of exec function
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-16 18:29:22 +02:00
Jaroslav Škarvada
f91892a4bf functions: added cpulist_present
This function filters the input cpulist against CPUs present on the
system. It returns unpacked list.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-16 17:39:17 +02:00
Jaroslav Škarvada
7c221de3a0 functions: fixed cpulist_pack to correctly deal with wrong arguments
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-16 17:38:18 +02:00
Jaroslav Škarvada
7ab7be15d0 functions: added cpulist_pack
Packs CPU list, i.e. 1, 2, 3 will be converted to 1-3. The cpulist_unpack is
used as a preprocessor, so it always returns optimal results. For details
about input syntax see cpulist_unpack.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-16 17:00:17 +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
Jaroslav Škarvada
cb6cf2b70b Added polkit and dbus to the requirements
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-15 13:24:14 +02:00
Jaroslav Škarvada
33a3012173 plugin_bootloader: consolidated Tuned name
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-14 16:53:00 +02:00
Jaroslav Škarvada
125b7520ae polkit: consolidated code syntax
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-14 15:37:52 +02:00
Jaroslav Škarvada
fccf3e8c50 tuned-adm: increased default timeout to 10 minutes
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-14 13:59:27 +02:00
Jaroslav Škarvada
fcd6490bbc dbus: fixed typos causing runtime tracebacks
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-11 12:31:46 +02:00
Jaroslav Škarvada
b9fac9dced polkit: fixed typo in DBusException
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-11 12:05:09 +02:00
Jaroslav Škarvada
2a593a46e9 polkit: added the policy to correct package and added fallback method
If there is problem with polkit, it tries to get the UID of the
sender process and in case it's root authorize the request.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-10 18:07:00 +02:00
Jaroslav Škarvada
68bb447a0f Implemented polkit authorization
Dropped dbus at_console policy and implemented polkit authorization.
By the default policy the query actions are allowed for all users, actions
which do modification to the system settings or Tuned state are by default
allowed only for active users that have console, others need admin
authorization.

Resolves: rhbz#1095142

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-10 11:57:33 +02:00
Jaroslav Škarvada
e86e1be083 polkit: consolidated polkit action IDs to match DBus names
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-08 17:36:00 +02:00
Jaroslav Škarvada
ec462180af tuned-adm: Another syntax error fix
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-08 16:32:37 +02:00
Jaroslav Škarvada
cac88bfdde tuned-adm: fixed syntax error
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-08 16:24:46 +02:00
Jaroslav Škarvada
57219da6c5 Introduced some Python 3 compatibility tweaks
Merged and modified patch from Ville Skyttä <ville.skytta@iki.fi>

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-08 15:03:54 +02:00
Jaroslav Škarvada
b117e9204b tuned-adm: rewrote multithreading code to glib
The glib/dbus doesn't like multithreading which is not handled
by them, thus the code may segfault. According to
https://bugzilla.redhat.com/show_bug.cgi?id=1330127#c2
it is not supportd and dbus-glib/dbus-python are not thread safe.
This commit moves multithreading under glib and handles all
in the glib mainloop, thus it may no longer segfaults.

It also adds --timeout, -t command line parameter which may
specify timeout for the sync operations, e.g.:
 # tuned-adm --timeout 200 profile balanced
wil use 200 seconds timeout when waiting for the profile to
load.

The default timeout was increased to 90 seconds to match
systemd default timeouts.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-07 17:58:45 +02:00
Jaroslav Škarvada
a174592cfd verify: added ignore-missing mode
The verify command can now be run in ignore-missing mode. In this mode
missing/non-supported settings (i.e. those which current value is None)
are ignored and not treated as errors.

The tuned-adm got new verify options -i and --ignore-missing which
enables the ignore-missing mode, usage:
  tuned-adm verify -i
or:
  tuned-adm verify --ignore-missing

The DBus interface got new method 'verify_profile_ignore_missing' which
does the verification in ignore-missing mode.

Resolves: rhbz#1243807

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-04-22 18:05:16 +02:00
Jaroslav Škarvada
b556805fe3 tuned-adm: fixed backtrace and lock if tuned daemon is not running
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-04-22 16:43:59 +02:00
Jaroslav Škarvada
67f78d632e tuned-adm: synchronous profile switching
By default tuned-adm now synchronously switch profiles, i.e it waits untill
the profile is applied and then returns to the shell. It returns with
exitcode 0 if profile is correctly applied. If there is an error it uses
exitcode > 0 (currently only 1 is used) and displays error. For reverting
to old behaviour (i.e. asynchronous profile switching) when the tuned-adm
returns immediately there is an tuned-adm command line option -a (or --async).

D-Bus API was extended to allow synchronous profile switching. Now the
"profile_changed" D-Bus signal is sent when the profile is applied. The
signal contains the following data:

profile_name:string - the name of the profile which was applied
result:boolean      - status of the operation, true if OK, false on error
errstr:string       - string containing description of the error (if result is
                      false)

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-04-21 14:55:19 +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
Jaroslav Škarvada
8c07abca27 Added tuned icon and desktop file for GUI
Icon provided by Mariia Leonova <mleonova@redhat.com>.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-03-22 17:11:42 +01:00
Jaroslav Škarvada
3dd36e257b spec: fixed typo in comment
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-01-13 14:12:25 +01:00
Jaroslav Škarvada
ca5ad59d3f spec: ghosted /etc/modprobe.d/kvm.rt.tuned.conf
Related: rhbz#1292117

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-01-11 14:41:42 +01: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
a2b0741eac pm_qos: fixed exception if PM_QoS is not available
Resolves: rhbz#1296137

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-01-06 14:14:19 +01:00
Jaroslav Škarvada
7e34a4fd27 new release (2.6.0)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-01-05 16:08:31 +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
d49469f711 plugin_sysctl: pass verification even if the option doesn't exist
In case sysctl option doesn't exist (e.g. is unsupported on the
system), the verification now passes.

Related: rhbz#1252153

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-11-16 18:22:28 +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
b26327d572 gui: fixed creation of new profile
Resolves: rhbz#1274609

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-10-27 17:56:09 +01:00
Jaroslav Škarvada
1f1d7e3235 spec: correctly remove tuned footprint from /etc/default/grub
The bootloader plugin adds there GRUB_CMDLINE_LINUX_DEFAULT tuned setting
which should be removed upon Tuned uninstallation. This commit fixes
the regex used in %postun to correctly remove the Tuned footprint from
there.

Resolves: rhbz#1268845

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-10-06 15:53:24 +02: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