1
0
Fork 0
Commit graph

812 commits

Author SHA1 Message Date
Jaroslav Škarvada
d008f960b0 Merge pull request #31 from olysonek/spindown
disk: Don't apply lower spindown value if drive has spun down
2017-03-28 18:13:07 +02:00
Ondřej Lysoněk
fe92ca56de disk: Delay a spindown change instead of suppressing it
After this change, any delayed changes of spindown are applied
as soon as the drive becomes active.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-28 17:06:55 +02:00
Ondřej Lysoněk
c50f1b9604 disk: Don't apply lower spindown value if drive has spun down
Don't run 'hdparm -S' with a lower spindown value than previously
applied, if the drive has already spun down. Executing the command
in that case makes the drive spin up with some HDDs.

Resolves https://github.com/redhat-performance/tuned/issues/1

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-28 15:23:09 +02:00
Jaroslav Škarvada
ef53b0696f Merge pull request #29 from olysonek/profile_apply_pr
Log errors when applying a profile fails
2017-03-27 14:32:53 +02:00
Ondřej Lysoněk
4acae0a356 Log errors when applying a profile fails
Log errors when applying a profile fails and also log explicitly
when we're trying to load the previously applied profile.

Resolves: rhbz#1434360

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-27 10:38:46 +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
Jaroslav Škarvada
a50d5e0237
assertion: fixed name shown in the log
Previosly it incorrectly shows 'exec' instead of 'assertion' in the
logs.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-21 09:45:06 +01:00
Jaroslav Škarvada
e052fd14a1
cpulist_present: explicitly sorted present CPUs
Resolves: rhbz#1432240

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-21 09:38:33 +01:00
Jaroslav Škarvada
8ddd7acb40
plugin_scheduler: fixed initialization
resolves: rhbz#1433496

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-17 20:37:05 +01:00
Jaroslav Škarvada
ceebc4a7c1
powertop2tuned: used UTF-8 encoding
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-15 14:09:50 +01:00
Jaroslav Škarvada
929c4ced7f powertop2tuned: added diacritics to credits
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-15 13:41:43 +01:00
Jaroslav Škarvada
c381b6a073 Merge pull request #28 from olysonek/policy
Allow running verify_profile_ignore_missing to all users
2017-03-15 13:20:20 +01:00
Ondřej Lysoněk
834dae9326 Allow running verify_profile_ignore_missing to all users
The policy for running the 'verify_profile_ignore_missing' D-Bus method
was missing, so only root could run it. This commit adds the policy, so
that it is the same as the policy for regular 'verify_profile'.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-15 13:10:33 +01:00
Jaroslav Škarvada
92d558b870 Merge pull request #27 from olysonek/script_hotplug_pr
Introduce script_pre and script_post options
2017-03-14 21:15:39 +01:00
Jaroslav Škarvada
893024a66a Merge pull request #26 from olysonek/profile_dir_func
Introduce ${i:PROFILE_DIR} function
2017-03-14 21:15:22 +01:00
Ondřej Lysoněk
b5b71ec27b Introduce script_pre and script_post options
All units (however only device-based plugins make sense) can now be
given the 'script_pre' and 'script_post' options.

The script referenced by 'script_pre' is run before applying and
verifying static tuning and 'script_post' is run after applying and
verifying. Durring unapplying tuning, the scripts are run in reversed
order, i.e. 'script_post' before unapplying and 'script_pre' after
unapplying static tuning.

The scripts are run for each device with the following arguments.
For apply:
script.sh apply <device_name>

For verify:
script.sh verify <device_name>

For unapply (the 'profile_switch' argument is given iff we're unapplying
tuning due to a profile switch):
script.sh unapply [profile_switch] <device_name>

Additinally, instances of hotplug plugins call the scripts when a device
is added/removed with the apply/unapply argument, the same way as shown
above.

The paths to the scripts must be absolute, you can use the ${i:PROFILE_DIR}
function to fill in the profile directory. The scripts are run with
the working directory set to the directory the scripts are in.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-13 10:51:52 +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
Ondřej Lysoněk
cd4943bdbf Introduce ${i:PROFILE_DIR} function, drop workdir option
Introduced the ${i:PROFILE_DIR} internal function, which can be used
in profiles and which expands to the directory in which the profile
configuration was found. It replaces the workdir option, which
was a bit problematic due to inheritance and the possibility
to change its value.

The ability to change the value of 'workdir' seems redundant,
as the same effect can be achieved by either specifying an absolute
path to files in unit configuration or by using a user defined
variable.

Note that now you need to specify an absolute path or use the
${i:PROFILE_DIR} functin in the initrd_add_dir and initrd_add_img
options of the bootloader plugin.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-13 09:34:45 +01:00
Jaroslav Škarvada
55a867ac13 Merge pull request #24 from olysonek/script_hotplug
Perform command cleanup in reversed order
2017-03-08 15:42:17 +01:00
Ondřej Lysoněk
0fb2933fd4 Perform command cleanup in reversed order
Clean up device and non-device commands it reversed order, compared to
the order in which they were applied. It makes more sense that way to me.

Related: rhbz#1246176

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-08 15:37:33 +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
6350862bbd
scsi_host: fixed probing of ALPM, missing ALPM logged as info
Resolves: rhbz#1416712

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-06 10:46:02 +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
Jaroslav Škarvada
4eadc691fc bootloader: added option initrd_remove_dir
To remove the source directory from which the initrd image is build, the
following can be used:

[bootloader]
initrd_remove_dir = True
initrd_add_dir = /tmp/tuned-initrd.img

This will create initrd image from the /tmp/tuned-initrd.img directory and
and then it removes the tuned-initrd.img directory from the /tmp.

Related: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 18:11:22 +01:00
Jaroslav Škarvada
d89ab6731b bootloader: remove initrd image during cleanup
Related: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 14:58:24 +01:00
Jaroslav Škarvada
00746dc674 Makefile: fixed nightly target to delete old files from the nightly repo
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-02 15:07:02 +01:00
Jaroslav Škarvada
8cef7cdb21 bootloader: fixed workdir autodetection
Also updated the core Tuned engine to support instance.workdir to get
the directory name the profile was loaded from.

Related: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-02 14:59:47 +01:00
Jaroslav Škarvada
a77119aff0 tuned: fixed exception if there is an option without section in profile
e.g. the following caused an exception:
include=profile

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-02 11:41:35 +01:00
Jaroslav Škarvada
1ba523b1f3 Merge branch 'master' of github.com:redhat-performance/tuned 2017-03-01 16:08:21 +01:00
Jaroslav Škarvada
047a7335b0 bootloader: add support for initrd overlays
The bootloader plugin now supports the following options:
  initrd_add_img=IMAGE
  initrd_add_dir=DIR
  initrd_dst_img=PATHNAME

The 'initrd_add_img' adds initrd overlay named IMAGE. The IMAGE is
added from the current profile directory. If IMAGE begins with '/' it's
taken as absolute path (e.g. initrd_add_img="/root/overlay.img").

The 'initrd_add_dir' creates initrd image from the DIR at first and then
adds the image as a overlay. The DIR is taken from the current profile
directory. If DIR begins with '/' it's taken as absolute path.

The 'initrd_dst_img' sets the name and location of the resulting initrd
image. Usually it is not needed to set it. By default the location of
initrd images is /boot and the name of the image is taken as a basename
of IMAGE or DIR. This can be overridden by 'initrd_dst_img'

Currently grub2-mkconfig doesn't support initrd overlays, so the initrd
settings are lost after 'grub2-mkconfig -o /boot/grub2/grub.cfg' is
issued. There is grub2 RFE bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1427899

Resolves: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-01 15:56:17 +01:00
Jaroslav Škarvada
e5df1728af Merge pull request #22 from olysonek/udev_pr
Assign hotplugged devices based on udev matching too
2017-03-01 15:54:37 +01:00
Jaroslav Škarvada
47c1bf24c7 Merge pull request #21 from olysonek/plugin_cleanup
Fix plugin cleanup
2017-03-01 15:52:09 +01:00
Ondřej Lysoněk
4a452dd157 Fix plugin cleanup
The plugins were not getting cleaned up properly, so e.g. after
a profile switch instances of the Plugin class would get piled up.

This fixes commit 363d74815a.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-01 10:36:29 +01:00
Jaroslav Škarvada
f775a3cab0 Merge pull request #20 from olysonek/udev_pr
Implement udev-based device matching
2017-03-01 10:09:41 +01:00
Ondřej Lysoněk
2a092a2739 Assign hotplugged devices based on udev matching too
Resolves: rhbz#1251240
This fixes commit f14ae65bd2.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-01 09:03:06 +01:00
Ondřej Lysoněk
f14ae65bd2 Implement udev-based device matching
A new option 'devices_udev_regex' can be used in profile
configuration to specify devices to which a plugin instance
should be applied.

The option can contain a python regular expression, as specified
in https://docs.python.org/2/library/re.html#regular-expression-syntax.
The expression is effectively matched against the output of
udevadm info --query=property -n <device_path>

If the option 'devices_udev_regex' is specified, the 'devices' option
is ignored. If it is not specified, then the matching is done the same
way as previously, i.e. against 'devices'.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-28 17:39:07 +01:00
Jaroslav Škarvada
4c1ed69f4a Merge pull request #19 from olysonek/pr
Remove the '_devices' attribute in plugins
2017-02-28 13:19:48 +01:00
Ondřej Lysoněk
a38b6eee99 Remove the '_devices' attribute in plugins
The _device attribute should always be the same as the union of
_assigned_devices and _free_devices, therefore it's redundant.
Its existence in my opinion brings only confusion and a potential
source of inconsistencies.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-27 14:54:46 +01:00
Jaroslav Škarvada
4b66f79290 Merge pull request #18 from olysonek/pr
Assign hotplugged devices in priority order too
2017-02-27 14:30:46 +01:00
Ondřej Lysoněk
bd3749fddd Assign hotplugged devices in priority order too
Resolves: rhbz#1246172

This fixes commit 363d74815a.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-27 14:14:04 +01:00
Jaroslav Škarvada
82f1a9a19d plugins: renamed instance_priority to priority
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-02-22 01:16:23 +01:00
Jaroslav Škarvada
5b1316a361 plugins: log instance name together with the plugin if it differs
I.e.

[myaudio]
type=audio

Will show in log as:
myaudio (audio)

and:
[audio]

Will show in log as:
audio

I.e. if the instance name and the plugin name is the same it will
not log the plugin name in braces.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-02-17 18:22:34 +01:00
Jaroslav Škarvada
9cf6c3f45c Merge pull request #16 from olysonek/instance_priority_pr
Implement instance priority
2017-02-17 16:45:02 +01:00
Ondřej Lysoněk
363d74815a Implement instance priority
Resolves: rhbz#1246172

Allow specifying order in which individual plugin instances are to be
executed.

Each instance can be given the 'instance_priority' option
in the profile configuration. The value must be an integer (it can be
negative). If no priority is specified, it is inherited from the parent
profile, or set to the default instance priority, if no parent profile
specifies the priority for that instance.

The default instance priority is by default zero, but it can be set to
a different value using the 'default_instance_priority' option in the
global configuration file.

Creating plugin instances, assigning devices to instances, initializing
instances, applying, updating and verifying tuning are all done in order
from lowest numerical instance priority to highest. Unapplying tuning and
destroying instances is done in reversed order.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-17 15:56:11 +01:00
Jaroslav Škarvada
82546e3027 Merge pull request #15 from olysonek/make_lint
Print path to affected files on 'make lint'
2017-02-17 12:46:17 +01:00
Jaroslav Škarvada
9e99925a9f Merge pull request #14 from olysonek/log_to_file
Fix logging to file in the current directory
2017-02-16 15:13:05 +01:00
Ondřej Lysoněk
233cf61a34 Print path to affected files on 'make lint'
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-16 14:41:04 +01:00
Jaroslav Škarvada
78c0319e4f Merge pull request #13 from olysonek/make_lint
Add 'lint' target to Makefile
2017-02-16 10:08:20 +01:00