If profile was quickly changed, e.g. profile loading failed and
previous profile was reloaded, multiple profile_changed DBus signals
could be received. If the signal is received before it is processed
deadlock may occure (i.e. 10 minut timeout).
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Kernel uses 'transparent_hugepage', but Tuned has been so far using
'transparent_hugepages', which was confusing. The new Tuned alias is
meant to improve the situation, so Tuned users can now use both variants.
It's possible that Tuned will drop 'transparent_hugepages' sometimes
in the future.
Resolves: rhbz#1249610
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This can be globally controlled by the 'reapply_sysctl' setting in
tuned-main.conf. If enabled, system systcls (/etc/sysctl.conf,
/etc/sysctl.d, ...) are reapplied after Tuned sysctls are applied,
i.e. Tuned sysctls don't override system sysctls. It's load
system sysctl by executing 'sysctl --system'. It's now by default
enabled.
Resolves: rhbz#1302953
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
In no_daemon mode it doesn't try to query DBus, so it doesn't
output DBus error.
Resolves: rhbz#1351536
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
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>
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>
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>
This function filters the input cpulist against CPUs present on the
system. It returns unpacked list.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
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>
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>
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>
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>
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>
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>
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>