On some Thinkpad laptops, it is possible to change the ACPI
platform profile using function keys (e.g., Fn+L). This can
now trigger a complete profile change if the functionality
is enabled.
Resolves#710.
To be consistent and make sure tuned-ppd works well with
its users no matter the configuration, the balanced profile
must be required in the configuration file, similarly to
the power-saver and performance profiles.
If no default profile is specified in the configuration,
this also sets the default profile to balanced, not raising
any exceptions like before.
This makes tuned-ppd fully API-compatible with
the latest power-profiles-daemon. The property
will signify the level of API compatibility with
power-profiles-daemon.
Instead of querying TuneD each time we want to determine the active
TuneD profile, remember its value. Also watch for signals from TuneD,
updating the value when the TuneD profile changes (resolves#689).
The daemon now also keeps track of the "base" PPD profile, which is
restored when all profile holds are released or when tuned-ppd is
restarted. For the latter purpose, this profile is also saved in a file.
Direct access via two dictionaries (one for AC, one for DC)
was clumsy, this commit replaces it with a new class - ProfileMap.
Make sure that we only initialize the UPower signal
handler only if such a handler is not already running.
This also reorders the order of operations in the initialization
procedure, skipping redundant initial TuneD profile changes.
- improved conditionals for better readability
- fixed tuned-ppd not to run install twice
- used macro for profiles path
- consolidated names of related variables
- updated Makefile to update the current profile paths during
installation
- fixed tests to use correct profile directory on RHEL/CentOS
- consolidated whitespaces and variable names in fixed tests
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The no_turbo knob only recognizes 0 or 1, so we have to
convert the option value defined in the profile to an
integer if necessary.
Related: #630
Resolves: RHEL-51760
Since 6ef5b58e , switch_profile expects self._on_battery to be
set, but when it's called in Controller.initialize, it is
called before we do self._on_battery = False , and will crash
with
AttributeError: 'Controller' object has no attribute '_on_battery'
if the requested profile is not the currently active one.
This fixes that by moving the call to switch_profile after
self._on_battery is set.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
Not clearing it before a profile switch would
result in never deleting the original plugin
objects - those would accumulate in memory with
each profile switch.
Relates: RHEL-36442
Before the `scheduler` plugin, `tuna` was used for CPU isolation.
There is a leftover use in the verification of the `realtime` profile.
Removing that, the dependency on the `tuna` package, and now-empty
scripts from the realtime profiles.
closes#594
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
The shell functions in profiles/functions related to irqbalance configuration
have been unused since 462df2610c. Remove them.
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
The option IRQBALANCE_BANNED_CPUS we're currently using has been deprecated [1],
so switch to IRQBALANCE_BANNED_CPULIST instead.
closes#656
[1] c995237885
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Allow to specify CPUs and uncores using package (socket) number.
type=cpu
devices=${f:package2cpus:2} # cpus from package 2
type=cpu
devices=${f:package2cpus:1*} # cpus from any package started from 1 i.e. 11, 12, 13 ...
type=uncore
devices=${f:package2uncores:1:5:9} # uncores from package 1, 5 and 9
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Using direct frequency values in only useful in specialistic profiles
where we know target platform. Allow to configure uncore frequency as
percent of hardware maximum/minimum frequency. Such parameters can be
used in generic profiles like 'balanced' in portable way, for example:
[uncore]
max_freq_khz=90%
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Do not report an error if a process is defunct even if it
is not bound to specific CPUs: failing to change its affinity
does not have any negative effects.
Refactor the helper function _affinity_changeable to
_ignore_set_affinity_error and make it return True/False
depending on whether the failed affinity change can be
ignored (i.e., not reported as an error).
Do not check for vanished processes twice, the later
check is sufficient.
Resolves: RHEL-46560
- Only use the default profile from the configuration file if
TuneD is not already running with an active profile. This
makes the daemon "recall" the active profile after a restart.
- Make sure that SIGHUP completely resets the daemon, including
resetting the 'battery' and 'performance_degraded' status.