1
0
Fork 0
Commit graph

963 commits

Author SHA1 Message Date
Ondřej Lysoněk
21e2f9735a defirqaffinity: Handle errors when settig smp_affinity
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-10-11 14:52:14 +02:00
Ondřej Lysoněk
f32f2a3ecc plugin_scheduler: Return PID as an integer in get_processes()
This fixes a traceback when unapplying group_* options.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-10-11 14:18:17 +02:00
Luiz Capitulino
03449e60f9 tuned: disable KSM in KVM low-latency profiles
KSM is enabled by default when the qemu-kvm-common-rhev package is
installed. We don't want KSM to run in KVM-RT nor cpu-partitioning
hosts, as it can cause spikes or packet drops.

This series disables KSM in those profiles when they are activated.
Likewise, we re-enable KSM when the profile is de-activated in
case it's enabled by default in systemd.

Luiz Capitulino (3):
  profiles: functions: add functions to disable/enable KSM
  realtime-virtual-host: disable KSM
  cpu-partitioning: disable KSM

 profiles/cpu-partitioning/script.sh      |  2 ++
 profiles/functions                       | 37 ++++++++++++++++++++++++++++++++
 profiles/realtime-virtual-host/script.sh |  3 +++
 3 files changed, 42 insertions(+)

--
2.9.5
Return-Path: lcapitulino@redhat.com
Received: from zmta04.collab.prod.int.phx2.redhat.com (LHLO
 zmta04.collab.prod.int.phx2.redhat.com) (10.5.81.11) by
 zmail22.collab.prod.int.phx2.redhat.com with LMTP; Tue, 3 Oct 2017 15:54:02
 -0400 (EDT)
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by zmta04.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 46F2FD0310
	for <jskarvad@mail.corp.redhat.com>; Tue,  3 Oct 2017 15:54:02 -0400 (EDT)
Received: by smtp.corp.redhat.com (Postfix)
	id 3FBC860F82; Tue,  3 Oct 2017 19:54:02 +0000 (UTC)
Delivered-To: jskarvad@redhat.com
Received: from localhost (ovpn-117-159.phx2.redhat.com [10.3.117.159])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 3A51A60F81;
	Tue,  3 Oct 2017 19:53:59 +0000 (UTC)
From: Luiz Capitulino <lcapitulino@redhat.com>
To: jskarvad@redhat.com
Cc: kvm-rt@redhat.com
Subject: [PATCH 1/3] profiles: functions: add functions to disable/enable KSM
Date: Tue,  3 Oct 2017 15:53:50 -0400
Message-Id: <20171003195352.22910-2-lcapitulino@redhat.com>
In-Reply-To: <20171003195352.22910-1-lcapitulino@redhat.com>
References: <20171003195352.22910-1-lcapitulino@redhat.com>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12

They will be used by the next commits.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2017-10-10 14:00:28 +02:00
Jaroslav Škarvada
66bef6e45a Merge pull request #74 from olysonek/fixes
Various fixes
2017-10-10 10:09:22 +02:00
Ondřej Lysoněk
a4346d2b48 Don't do full rollback on systems without systemd when tuned is exiting
Fixes commit 701f09a8.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-26 13:03:02 +02:00
Ondřej Lysoněk
7e7b1ee878 plugin_net: Allow disabling dynamic tuning
The net plugin can now be given the boolean 'dynamic'
option, which is used to determine, whether dynamic tuning
should be enabled.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-26 10:44:33 +02:00
Ondřej Lysoněk
cf87220216 Allow applying multiple profiles
The 'tuned-adm profile' command can now (once again) be given multiple
profile names. In case of conflicting settings in the profiles, the
setting from the last profile specified is used.

E.g.:
tuned-adm profile powersave balanced

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-26 10:44:33 +02:00
Ondřej Lysoněk
ed8bf19ec2 Fix hang when 'tuned-adm profile' is given empty profile name
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-26 10:42:53 +02:00
Ondřej Lysoněk
d78565a205 Start dbus exports after a profile is applied
We should register to dbus after a profile is fully applied when
starting up. This makes systemd services depending on some tunings
performed by tuned (with After=tuned.service in their service file)
to start only after all tunings were applied.

Resolves: https://github.com/redhat-performance/tuned/issues/23
Resolves: rhbz#1443142

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-26 10:22:17 +02:00
Jaroslav Škarvada
65b3cae0cc Merge pull request #72 from olysonek/radeon
plugin_video: Prefix DPM states with 'dpm-'
2017-09-20 13:49:05 +02:00
Ondřej Lysoněk
f9f261e820 plugin_video: Prefix DPM states with 'dpm-'
Prefix DPM states with 'dpm-' to prevent future name collisions.
Also, change the state in powersave profiles to 'battery' - there's
no such DPM state as powersave.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-19 23:03:41 +02:00
Jaroslav Škarvada
513a6ca25f Merge pull request #71 from olysonek/auto_profile
Store profile selection mode in a separate file
2017-09-19 17:23:13 +02:00
Ondřej Lysoněk
f3d170f7bd Add profile_mode file to Makefile and spec
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-19 17:07:21 +02:00
Jaroslav Škarvada
182d3f4abd Merge pull request #70 from olysonek/replace_ethtool_in_scripts
Replace ethtool invocation in scripts by built-in functionality
2017-09-19 16:50:54 +02:00
Ondřej Lysoněk
b970238a3d profiles: Use net plugin to disable LRO in sap-hana-vmware
Use net plugin to disable large receive offload in sap-hana-vmware profile.
This also fixes rollback of the setting - previously, after unapplying
the profile, LRO would always be set to 'on', irrespectively of the
original setting.

The network interfaces which should have LRO disabled must be listed
in /etc/tuned/sap-hana-vmware-variables.conf, e.g. like this:
sap_hana_vmware_nic=eth0

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-19 16:38:15 +02:00
Jaroslav Škarvada
5971003b0d Merge pull request #69 from olysonek/makefile
Makefile: Make use of SCRATCH_BUILD_TARGET, change it to rhel-7.5-candidate
2017-09-19 15:55:59 +02:00
Jaroslav Škarvada
de2b132a8e Merge pull request #68 from olysonek/doc
Documentation updates
2017-09-19 15:55:09 +02:00
Jaroslav Škarvada
c3be853a76 Merge pull request #67 from olysonek/dbus_exporter_race
Fix race between DBus exporter startup and applying a profile
2017-09-19 15:42:30 +02:00
Jaroslav Škarvada
97c28b3404 Merge pull request #66 from olysonek/master
Fix applying a profile from cloud-init
2017-09-19 15:41:13 +02:00
Jaroslav Škarvada
eef09f1185
plugin_video: merged radeon 'dpm' into radeon_powersave
Now, in addition to the already supported Radeon power methods, it also
supports:

radeon_powersave=DPM

where DPM can be 'battery', 'balanced', or 'performance'.

It also supports fallback, so one can write:

radeon_powersave=balanced, auto

where it tries 'balanced' DPM profile and if it fails or is not
supported it fallbacks to the non DPM 'auto' profile.

As delimiters colon, semilocon, comma or whitespace can be used.

It also switched upstream profiles to prefer DPM.

https://github.com/redhat-performance/tuned/pull/32

Related: rhbz#1417659

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-09-19 14:57:26 +02:00
Jaroslav Škarvada
dd6460be8d Merge pull request #32 from olysonek/radeon
[WIP] Video plugin improvements
2017-09-19 11:57:55 +02:00
Ondřej Lysoněk
b2c80cabe5 Store profile selection mode in a separate file
The profile selection mode is now written to /etc/tuned/profile_mode
instead of the second line of /etc/tuned/active_profile.

Here are the rules for interpreting the contents of the files. If
either of the files does not exist, it is treated the same as if
it were empty.

If active_profile is empty:
    If profile_mode contains 'manual':
        Manual mode, no profile will be used, tuned will run without a profile
    else if profile_mode is empty or contains 'auto':
        Automatic mode, recommended profile is used
    else:
        Error
else:
    If profile_mode contains 'manual', or is empty (for compatibility reasons):
        Manual mode, the profile in active_profile will be used
    else if profile_mode contains 'auto':
        Automatic mode, recommended profile is used
    else:
        Error

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

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-18 10:50:41 +02:00
Ondřej Lysoněk
179886cf51 net: Fix rollback for large receive offload
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-13 13:19:38 +02:00
Ondřej Lysoněk
313355ad32 net: Move a comment
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-12 15:16:51 +02:00
Ondřej Lysoněk
37ebbc322b Makefile: Make use of SCRATCH_BUILD_TARGET, change it to rhel-7.5-candidate
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-12 14:22:40 +02:00
Ondřej Lysoněk
fed000fd64 Fix typos in TIPS.txt
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-12 13:23:31 +02:00
Ondřej Lysoněk
297a154440 Update README
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-12 13:23:31 +02:00
Ondřej Lysoněk
41d8e79162 Update man pages
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-12 13:23:10 +02:00
Ondřej Lysoněk
a5d2a6e4d3 Fix race between DBus exporter startup and applying a profile
Previously if the profile was applied before all methods and
signals were exported on DBus, the daemon thread (_thread_code()
in daemon.py) could crash after attempting to emit a signal on DBus
announcing that a profile was applied.

A regular user is unlikely to run into the race in practice, but it
frequently happens when applying an empty profile for testing purposes.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-11 09:27:14 +02:00
Ondřej Lysoněk
701f09a89d Improve checking if we are rebooting or not
'systemctl is-system-running' is not enough to reliably check
if the system is shutting down. If the command is run when the system
is still starting up, it will report the state as 'starting', even if
the shutdown target is queued:
5463fa0a88/src/core/manager.c (L3457-L3465)

On the other hand, 'systemctl list-jobs' should always show
shutdown.target or reboot.target etc., when the system is shutting
down, as long as DBus is still running.

Resolves: rhbz#1475571
Resolves: rhbz#1488369
Resolves: rhbz#1488517

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-08 16:16:50 +02:00
Ondřej Lysoněk
bfab9d8d22 tuned-adm: Increase DBus call timeout to 40 seconds
Increase timeout for DBus method calls in tuned-adm to 40 seconds.
This is meant to prevent simultaneous timeouts in tuned-adm and
the tuned daemon.

Previously it could happen, that e.g.
 tuned-adm profile <name>
was executed, issuing a DBus call to the tuned daemon,
then in response the tuned daemon would issue a DBus
call to Polkit in order to authorize the profile switch request, and
this call would time out. The call to Polkit would time out after the
default DBus timeout of 25 seconds and simultaneously the tuned-adm's
call to tuned daemon would also time out, because the same default
timeout was used. After that, if the fallback authorization method
in tuned daemon succeeded, the daemon would start applying the new
profile, and at the same time tuned-adm would use the fallback method,
which is restarting tuned (systemctl restart tuned). This could
potentially lead to all sorts of race conditions. Let's avoid that
by increasing the timeout in tuned-adm, so that tuned has time
to apply a profile after a failed Polkit call.

Related: rhbz#1475571

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-09-07 16:03:59 +02:00
Jaroslav Škarvada
ab598cd6ef Merge pull request #63 from olysonek/logging
Improve logging
2017-08-29 18:21:35 +02:00
Jaroslav Škarvada
d2c170a42e
plugin_systemd: on full_rollback notify about need of initrd regeneration
Resolves: rhbz#1469258

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-08-29 13:48:14 +02:00
Ondřej Lysoněk
f9f5b073a5 scheduler: Improve logging
Debug messages are now logged when setting some task's parameter
fails because the task vanished. Previously errors were logged.

Log messages (for kernel threads and zombie processes) or warnings
(otherwise) are now logged when setting a task's affinity fails because
its affinity is fixed. Previously either errors or nothing was logged,
depending on the specific case.

Resolves: rhbz#1474961

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-29 13:47:13 +02:00
Ondřej Lysoněk
ff6f69f604 Don't log errors about missing files on verify with ignore_missing set
Take the ignore_missing parameter into account in @command_get methods
so that error messages are not logged for missing files.

In some @command_get methods the ignore_missing parameter is not used,
because e.g. it is not applicable or the parameter is handled elsewhere
in the code.

Resolves: rhbz#1451435

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-28 14:45:29 +02:00
Jaroslav Škarvada
bccfe3e8d1 sap-hana: fixed description of the sap-hana profiles
Resolves: rhbz#1482005

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-08-21 13:40:22 +02:00
Jaroslav Škarvada
43c1b819d3 Merge pull request #62 from olysonek/epb_unsupported_log_msg
cpu: Don't log error in execute() if EPB is not supported
2017-08-21 12:54:58 +02:00
Ondřej Lysoněk
acc1427a4f cpu: Don't log error in execute() if EPB is not supported
Don't log error in commands.execute() if MSR_IA32_ENERGY_PERF_BIAS
is not supported. A message with level WARN is already logged
afterwards:

WARNING  tuned.plugins.plugin_cpu: your CPU doesn't support
         MSR_IA32_ENERGY_PERF_BIAS, ignoring CPU energy performance bias

Resolves: rhbz#1443182

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-21 12:34:27 +02:00
Jaroslav Škarvada
2c3d96621e
spec: make kernel-tools weak dep
The kernel-tools is not available on all arches and Tuned can work
without it.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-08-21 11:15:30 +02:00
Ondřej Lysoněk
750530de2e bootloader: Don't add nonexistent overlay image to grub.cfg
Resolves: rhbz#1454340

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-16 09:59:35 +02:00
Jaroslav Škarvada
a83170deb7 Merge pull request #61 from olysonek/udev_monitor_buffer_size
Increase udev monitor buffer size, make it configurable
2017-08-15 15:51:33 +02:00
Ondřej Lysoněk
36aa31efb4 Increase udev monitor buffer size, make it configurable
The udev monitor buffer size was increased to 1MB. Also, a new
configuration option 'udev_buffer_size' can be specified in
/etc/tuned/tuned-main.conf to set a different buffer size.
Values such as '204800', '200KB', '200 KB' (with space) or '1 MB'
are recognized. If no unit is specified, the number is taken as
the number of bytes.

Resolves: rhbz#1442306

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-15 13:04:01 +02:00
Jaroslav Škarvada
79e519784b
recommend: rename our default recommend rule file to 50-tuned.conf
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-08-09 16:56:10 +02:00
Jaroslav Škarvada
0a2c210db3 Merge pull request #60 from olysonek/recommend.d_rebase
Recommend.d functionality
2017-08-09 16:08:44 +02:00
Ondřej Lysoněk
fde8e806a0 Implement recommend.d functionality
Configuration files for the recommend functionality can now be
added to the /etc/tuned/recommend.d and /usr/lib/tuned/recommend.d
directories. The format is the same as in /etc/tuned/recommend.conf.
The file /etc/tuned/recommend.conf takes precedence over the files
in the recommend.d directories. The files in the /etc/tuned/recommend.d
directory are merged with those in /usr/lib/tuned/recommend.d
(in case of name conflict the file from /etc/tuned/recommend.d is used)
and are evaluated in alphabetical order. The first file containing
a matching entry is used.

The /etc/tuned/recommend.d directory is meant mainly for use by
administrators. Third-party packages should install recommend
configuration files in /usr/lib/tuned/recommend.d.

Also, the file /usr/lib/tuned/recommend.conf was moved to
/usr/lib/tuned/recommend.d/50-tuned-recommend.conf.

Resolves: rhbz#1459146

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-09 14:53:55 +02:00
Ondřej Lysoněk
cd655df597 Add 'tuned-adm profile_mode' command
Implement a new 'tuned-adm profile_mode' command, which prints
the current profile mode - automatic vs. manual.

Related: rhbz#1459146

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-03 15:24:17 +02:00
Ondřej Lysoněk
bc8ffcfb23 Introduce the concept of manually vs automatically set profile
A profile can now be set in two modes: automatic and manual.

When the automatic mode is active, Tuned always activates the
recommended profile upon startup. This mode can be set using
the following command:
tuned-adm auto_profile

When the manual mode is active, the previously applied profile
is activated upon startup. This mode can be set by switching
to the desired profile, e.g.
tuned-adm profile throughput-performance

The mode is saved on the second line of /etc/tuned/active_profile.

When the file /etc/tuned/active_profile does not exist, or is
empty, automatic mode is enabled. When the file has only one line,
i.e. it was generated by a previous Tuned version, manual mode
is enabled so that the upgrade doesn't cause unexpected active profile
changes.

Related: rhbz#1459146

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-03 15:23:54 +02:00
Ondřej Lysoněk
4e90f14941 bootloader: Accept only certain values for initrd_remove_dir
Only 'y', 'yes', 't', 'true' and '1' are accepted as true values
for initrd_remove_dir (case insensitive). Other values are
interpreted as false.

Resolves: rhbz#1455161

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-01 09:31:25 +02:00
Ondřej Lysoněk
b776b7420c disk: Fix traceback in dynamic tuning
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-07-24 16:42:28 +02:00
Jaroslav Škarvada
962bae3d71
realtime profiles: dropped tuna invocation from host/guest
Tuna is already executed in the realtime profile which is included by
the realtime-virtual-host/guest profiles, there is no need to execute
it twice. Also fixed minor whitespace inconsistency.

Related: rhbz#1472840

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-07-19 18:35:17 +02:00