1
0
Fork 0
Commit graph

1276 commits

Author SHA1 Message Date
Jaroslav Škarvada
e8393c5c0a
spec: improved python macros handling
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-21 23:40:03 +01:00
Jaroslav Škarvada
7a28246835
new release (2.11.0)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-21 23:10:46 +01:00
Jaroslav Škarvada
02c2d5752f
Merge pull request #172 from olysonek/geteuid
Check for root privileges by inspecting the effective UID
2019-03-21 22:48:04 +01:00
Jaroslav Škarvada
4f2f46da85
Merge pull request #171 from TomasKorbar/improve_tdadm_recommend
Improve logging of tuned-adm recommend
2019-03-21 22:47:06 +01:00
Tomas Korbar
4632629727 Add log of warning to profile recommenders parser of virt condition
When profile recommender is executed without root privileges than
he can not execute virt-what to determine virt conditions in
recommend.d files. This caused several error messages which could
be confusing for user.

Add log of warning about this to profile recommender so user knows
exactly what is happening and why profiles with virt
recommendation condition are ommited from recommendation process
when user has not root privileges.

Behaviour of recommend process has not been changed.

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-21 16:27:36 +01:00
Ondřej Lysoněk
4fdb48ef34 Check for root privileges by inspecting the effective UID
The effective UID is what matters when it comes to the ability to
perform privileged actions, not the real UID.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-21 11:10:28 +01:00
Jaroslav Škarvada
9d83b77572
recommend: use dmidecode only on x86(64)
Resolves: rhbz#1688371

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-14 15:44:47 +01:00
Tomas Korbar
cccbf6f11e Fix typo in profile_recommender
Execute method from Commands class takes array of strings as
arguments to execute not a name of executable.
This caused bad format of logged error message in case of failure
of execute method.

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-13 14:45:15 +01:00
Jaroslav Škarvada
033e35b4c4 doc: renamed doc/guide to doc/manual
After team discussion we decided to rename it to manual.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-13 14:39:55 +01:00
Jaroslav Škarvada
08b932c8b0
Merge pull request #170 from olysonek/fix_plugin_net
For stable: Fix regressions in plugin_net
2019-03-12 21:25:01 +01:00
Jaroslav Škarvada
94d70899c9
doc: installed html instead of the adoc
Also added support to the Makefile and spec.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-12 19:57:15 +01:00
Jaroslav Škarvada
7efac3bcb3
doc: renamed tuned-documentation to guide
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-12 19:02:22 +01:00
Ondřej Lysoněk
4d12eeff81 net: Fix verification
In commit 0d28f9e63e, verification has been accidentally
dropped from the _custom_parameters method. Fix it.

Fixes #135

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-12 14:19:05 +01:00
Ondřej Lysoněk
e88c72d5b6 Refactor verification result logging into a separate method
The method is useful for plugins that do their own verification.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-12 14:11:42 +01:00
Ondřej Lysoněk
59c1282c0e net: Fix rollback
Starting with commit 0d28f9e63e, values that have been applied
were stored instead of the original values, which broke rollback. Fix it
by storing the actual original values.

Fixes #135

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-12 13:43:36 +01:00
Ondřej Lysoněk
2317e28654 net: Rename local variables
Rename local variables to make the code more readable.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-12 12:51:34 +01:00
Jaroslav Škarvada
45be167807
Makefile: fixed support for pre-releases
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-11 19:04:11 +01:00
Jaroslav Škarvada
1d80c8ae5f
Merge pull request #169 from TomasKorbar/rhbz1687397
Fix tuned-adm recommend off-daemon mode
2019-03-11 17:39:34 +01:00
Tomas Korbar
e7eed22cfb Fix tuned-adm recommend off-daemon mode
When i moved recommend functionality to its own class i did not
notice that 'tuned-adm recommend' command uses it from commands
class when tuned daemon is not running

Added ProfileRecommender to imports and changed old calls

Resolves: rhbz#1687397

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-11 17:12:00 +01:00
Jaroslav Škarvada
f521439b5c
new release (2.11.0-rc.1)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-10 21:00:05 +01:00
Jaroslav Škarvada
f3228390f9
spec: do not require python/python3 dmidecode
If "recommends" is not supported do not use "requires" for
python/python3 dmidecode, because dmidecode is not available on
all architectures.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-10 20:54:46 +01:00
Jaroslav Škarvada
02e8f26389
man: added simple entry for hpc-compute profile
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-10 15:32:14 +01:00
Jaroslav Škarvada
6e6c7e3e6b
spec: dropped com.redhat.tuned.gui.policy
It's leftover. The policy was dropped because the GUI no longer requires
root.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-10 11:28:18 +01:00
Jaroslav Škarvada
5da98a7598
spec: added conditionals for RHEL-7
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-10 11:26:55 +01:00
Jaroslav Škarvada
7aee4a888a
Merge pull request #168 from TomasKorbar/pr138_fix
Fix issues from pullrequest 138
2019-03-08 18:36:37 +01:00
Tomas Korbar
2d04276e54 Update tuned-adm manpage
Added documentation for new options of tuned-adm list command

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-08 15:24:17 +01:00
Tomas Korbar
d0f5a4c5c6 Stop adding recommend.d to list of profiles in tuned-gui
This happend because of insufficient testing of folders in tuned
profile directories
GuiProfileLoader now makes sure folder contains profile by
checking if folder contains tuned.conf file

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-08 14:23:55 +01:00
Tomas Korbar
cac75962a5 Remove testing config option hints from audio plugin
I tested hints for plugin options with these hints and
apparently forgot about them

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-08 14:18:11 +01:00
Tomas Korbar
c0a2e1964a Fix problem with tuned-adm list command on python2
Unfortunately non-required subcommands are not supported by argparse
module on python2, so selection between plugins and profiles must be
done by new positional non-required arguments "profiles" and
"plugins"

Examples of usage:
$ tuned-adm list -- will list tuned profiles like before
$ tuned-adm list profiles -- new command which has the same function
as tuned-adm list
$ tuned-adm list plugins -- will list tuned accessible plugins
$ tuned-adm list plugins [-v|--verbose] -- will list tuned accessible
plugins + their configuration options and hints how to use them

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-08 14:18:11 +01:00
Jaroslav Škarvada
eb451f3e65
Merge pull request #167 from olysonek/hotplug-races
Fix hotplug-related races and other issues
2019-03-07 17:36:37 +01:00
Jaroslav Škarvada
93616fb02b
Merge pull request #165 from olysonek/intel_pstate_scaling_governors
Fallback to the 'powersave' CPU scaling governor in the 'balanced' and 'powersave' profiles
2019-03-07 17:17:56 +01:00
Tomas Korbar
a0f3bb3bb0 Fix typo in tuned-adm
list plugins command had badly spelled option verbouse
changed to verbose

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-03-07 14:49:20 +01:00
Ondřej Lysoněk
8a0338307e Make a copy of devices when verifying tuning
When verifying tuning, we need to iterate over the
instance.processed_devices set. That set is modified by the
MonitorObserver thread when a new device is added to the system.
If the device is added to the set while the set is being iterated,
it results in an exception:
RuntimeError: Set changed size during iteration

One possible solution would be to acquire a lock before accessing the
set, however that could hold up the MonitorObserver thread
unnecessarily. It's better to just take a copy of the set. We don't
really care if the instance.processed_devices set changes during the
iteration.

Resolves: rhbz#1592743

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 19:56:13 +01:00
Ondřej Lysoněk
a9f2b27d30 Rework device handling to avoid races caused by hotplug
This patch fixes (at least) the following race conditions:
1. If a device is attached while iterating assigned devices, the
   MonitorObserver thread can attempt to insert the newly attached
   device to the assigned_devices set while the set is being iterated,
   which results in the following exception:
   RuntimeError: Set changed size during iteration
2. Some devices can be missed when applying a tuning - devices are enumerated
   (i.e., Plugin._init_devices() gets called) before udev device monitoring is
   started (hotplug.Plugin._hardware_events_init() gets called), so devices
   that appear between these two actions are not tuned.
3. Device monitoring is stopped too late, which can result in some tunings
   not being unapplied after stopping a profile. This can happen for devices
   that get added during profile rollback after unit_manager.stop_tuning()
   gets called, but before unit_manager.destroy_all() gets called.
4. It can happen that tuning is applied twice for a device if it is added
   during profile activation, e.g. after unit_manager.create() is called in
   Daemon._thread_code(), but before unit_manager.start_tuning() is called.
   Apart from unnecessarily applying the tuning twice, it can result in
   overwriting saved original settings for the device and hence our inability
   to properly roll back our changes to the settings.
5. The observer thread can attempt to use load_monitor before it's created
   in Plugin._instance_init(), which can result in AttributeError.

Hopefully it doesn't introduce new race conditions :).

The fix is to:
1. rearrange the sequence of certain actions,
2. separate Instance.devices to two separate sets: processed_devices
   and assigned_devices.

   processed_devices are never iterated when the MonitorObserver thread
   is running (*), so the first problem described above cannot happen.
   The set is used to store devices, which have already been tuned.

   The assigned_devices set is now the set of devices that are going
   to be tuned. The set can only be accessed by the main thread.

   (*) Except when verifying tuning - this is fixed in a follow-up patch

I tried to separate the changes into more digestable patches, but I
couldn't figure out how.

Resolves: rhbz#1592743

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 19:52:07 +01:00
Ondřej Lysoněk
4287b61fdb monitors: Fix adding a hotplugged device to a monitor
If a device, namely a disk, is hotplugged after tuned is started, it
won't be present in Monitor._available_devices. Consequently, it won't
get added to the monitor and so dynamic tuning won't work for the
device. Let's fix that by refreshing the list of available devices when
adding a device to a monitor.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 19:51:10 +01:00
Ondřej Lysoněk
04168eaa57 Remove unused _remove_unused_filters()
_remove_unused_filters() is not used anywhere and the udev's
remove_filter() is broken anyway:
https://github.com/systemd/systemd/issues/11529

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 19:51:10 +01:00
Ondřej Lysoněk
145b4551b4 Log full stack trace of unhandled exceptions as an error
Hiding the full stack trace in the debug output is not useful - it hides
information that would be useful for us when diagnosing a failure. It's
not always possible (and it's certainly an unnecessary burden for the
users) to later reproduce the issue with debug mode on. As a bonus, the
traceback will now stand out in the log, increasing the likelihood
that it will get noticed and reported.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 19:51:10 +01:00
Jaroslav Škarvada
c7b92148c2
Merge pull request #164 from olysonek/none_comparison
Fix checking for None values
2019-03-06 16:21:17 +01:00
Ondřej Lysoněk
9e6913231d Fix checking for None values
In python, 'is None' should be used instead of '== None' to check if
something is None.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 15:46:34 +01:00
Jaroslav Škarvada
e5fbac1863
Merge pull request #163 from olysonek/profile_dir_fixup
Update tuned.conf(5) and powertop2tuned to use ${i:PROFILE_DIR}
2019-03-06 15:14:33 +01:00
Jaroslav Škarvada
30d5fdb78e
Merge pull request #160 from olysonek/sysctl
Apply sysctl settings by writing to /proc/sys directly
2019-03-06 15:13:19 +01:00
Ondřej Lysoněk
f52be8843b powersave: Fallback to the 'powersave' scaling governor
Fallback to the 'powersave' CPU scaling governor if 'ondemand' is
not available. This can happen if the intel_pstate driver is active - at
least on newer kernels, the only available governors are 'powersave' and
'performance' if the driver is active.

As far as we can tell, the 'powersave' governor is the closest to the
'ondemand' governor.

Resolves: rhbz#1679205

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 11:41:56 +01:00
Ondřej Lysoněk
8de59ffee2 balanced: Fallback to the 'powersave' scaling governor
Fallback to the 'powersave' CPU scaling governor if 'conservative' is
not available. This can happen if the intel_pstate driver is active - at
least on newer kernels, the only available governors are 'powersave' and
'performance' if the driver is active.

As far as we can tell, the 'powersave' governor is the closest to the
'conservative' governor.

Resolves: rhbz#1679205

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 11:41:56 +01:00
Ondřej Lysoněk
52873fa9c8 cpu: Support specifying fallback CPU scaling governors
The 'governor' option of the 'cpu' plugin now supports specifying
multiple governors. The governors are separated using '|' (the '|'
character is meant to represent a logical 'or' operator; we already use
the same syntax for the 'energy_perf_bias' option). Tuned will set
the first governor that is available on the system.

For example, with the following profile, Tuned will set the 'ondemand'
governor, if it's available. If it's not available, but the 'powersave'
governor is available, 'powersave' will be set. If neither of them are
available, the governor will not be changed.

[cpu]
governor=ondemand|powersave

Resolves: rhbz#1679205

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 11:41:21 +01:00
Jaroslav Škarvada
aa5bda3ce1
balanced: added explicit priority to CPU plugin instance
Related: #158

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-03-06 11:28:56 +01:00
Jaroslav Škarvada
ec4ce18c8f
Merge pull request #158 from watologo1/fix_conservative_module_loading
conservative governor may be compiled as module and needs explicit lo…
2019-03-06 11:25:21 +01:00
Ondřej Lysoněk
054e24d451 powertop2tuned: Use ${i:PROFILE_DIR} in the generated profile
Since commit cd4943bdbf, it is recommended to use ${i:PROFILE_DIR}
in paths to scripts, in order to make the paths absolute. So let's make
the profile generated by powertop2tuned conform to that recommendation.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-05 10:20:05 +01:00
Ondřej Lysoněk
a484c644c5 man: Use ${i:PROFILE_DIR} in the example profile
Since commit cd4943bdbf, it is recommended to use ${i:PROFILE_DIR}
in paths to scripts, in order to make the paths absolute. It's not
required (yet) though.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-05 10:16:44 +01:00
Jaroslav Škarvada
18118c2814 s2kb: fixed to be compatible with python3
Resolves: rhbz#1684122

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-02-28 14:42:00 +01:00
Jaroslav Škarvada
7332a0917f
Merge pull request #153 from nealepetrillo/master
Added profile for HPC compute workloads
2019-02-28 10:00:42 +01:00