1
0
Fork 0
Commit graph

2055 commits

Author SHA1 Message Date
Jaroslav Škarvada
44ef03033a
Merge pull request #707 from zacikpa/ppd-fix-cookies
tuned-ppd: Disallow releasing profile holds of other processes
2025-01-15 01:12:13 +01:00
Jaroslav Škarvada
a252fa1573
Merge pull request #705 from yarda/systemd-boot-workaround
Add variables to BLS entries only if grub is used
2025-01-15 01:10:09 +01:00
Jaroslav Škarvada
54b29a145f
Merge pull request #703 from yarda/powertop2tuned-profiles-location-fix
powertop2tuned: use default user profile path from the consts
2025-01-15 01:09:14 +01:00
Jaroslav Škarvada
af4c14bc01
Merge pull request #688 from zacikpa/dirty-bytes
Explicitly support vm.dirty_(bytes|ratio) and vm.dirty_background_(bytes|ratio)
2025-01-15 01:08:23 +01:00
Jaroslav Škarvada
8fe0803fea
Merge pull request #694 from yarda/obsolete_ppd
Obsolete power-profiles-daemon
2025-01-15 01:07:18 +01:00
Jaroslav Škarvada
6bb6911fee
Merge pull request #698 from zacikpa/polkit-ppd-fix
tuned-ppd: Unify polkit policy with power-profiles-daemon
2025-01-15 01:06:29 +01:00
Pavol Žáčik
3535365c9c
tuned-ppd: Disallow releasing profile holds of other processes
Add a check which raises an error if the caller of ReleaseProfile
is not identical to the caller of HoldProfile.

Do not number cookies from 0, use pseudo-random integers.

Do not allow null cookies, which may cause issues in clients.
E.g., in gnome-settings-daemon, a null cookie means that it
currently has no active hold.
2025-01-14 20:49:48 +01:00
Pavol Žáčik
137b341068
tuned-ppd: Unify polkit policy with power-profiles-daemon
Rename HoldProfile/ReleaseProfile polkit actions to
hold-profile/release-profile.

Add the switch-profile action and check against it when
switching the profile using the ActiveProfile DBus property.

The changes require some refactoring of the DBusExporter class,
mainly because we need to be able to supply a custom polkit action
name instead of deriving it from the DBus method name.
2025-01-14 18:32:20 +01:00
Jaroslav Škarvada
fb1814fe7e
Merge pull request #697 from zacikpa/ppd-fix-adding-hold
tuned-ppd: Use effective hold profile when adding profile holds
2025-01-13 22:32:57 +01:00
Kate Hsuan
ff58c276a9
Obsolete power-profiles-daemon
Set an Obsoletes: tag to remove power-profiles-daemon package.

Resolves: #2293628
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-13 22:27:47 +01:00
Jaroslav Škarvada
84a58f2d4e
Merge pull request #684 from zacikpa/ppd-namespace
tuned-ppd: Support the new UPower PPD namespace
2025-01-13 22:07:56 +01:00
Pavol Žáčik
52768f78e4
Document new vm plugin options 2024-12-11 21:07:38 +01:00
Pavol Žáčik
155f2323a4
Adjust profiles to set dirty_(bytes|ratio) via the vm plugin 2024-12-11 21:05:21 +01:00
Pavol Žáčik
7ab8752705
vm: Add support for dirty_(bytes|ratio) sysctl parameters
And for dirty_background_(bytes|ratio).

These parameters interact with each other; it is therefore
not sufficient to configure them via the sysctl plugin.

For more details, see
https://docs.kernel.org/admin-guide/sysctl/vm.html#dirty-bytes.

Resolves: RHEL-58820
2024-12-11 21:05:19 +01:00
Pavol Žáčik
456ec3c0f8
tuned-ppd: Support the new UPower PPD namespace
Since version 0.20, power-profiles-daemon exposes
its DBus interface under "org.freedesktop.UPower.PowerProfiles"
alongside the previous name. To be compatible with PPD, this commit
implements the same change into tuned-ppd.

Resolves: #683
2024-12-11 20:56:06 +01:00
Jaroslav Škarvada
297e240834
Merge pull request #693 from zacikpa/autodocs
Automatic generation of plugin docs from their docstrings
2024-12-11 20:39:03 +01:00
Jaroslav Škarvada
cd44cbac75
Merge pull request #691 from zacikpa/perf-events-fix
scheduler: Do not assume that perf events have type attribute
2024-12-11 19:09:27 +01:00
Jaroslav Škarvada
0c33999ef9
Merge pull request #687 from adriaan42/adriaan/fix-verify-all-device-commands
fix: expand variables in Plugin._verify_all_device_commands
2024-12-11 18:01:52 +01:00
Jaroslav Škarvada
eb460a1f05
Merge pull request #686 from dufuhang/master
`check_positive` has some contradictions
2024-12-11 17:48:32 +01:00
Jaroslav Škarvada
ceff544bda
Merge pull request #681 from gsauthof/service-mkdir
Allow shared service drop-in directory
2024-12-11 17:42:28 +01:00
Jaroslav Škarvada
f22120c54a
Merge pull request #680 from evgeni/drop-cpuspeed
drop support for cpuspeed
2024-12-11 16:49:31 +01:00
Jaroslav Škarvada
c829fa5f41
Merge pull request #679 from zacikpa/no_turbo_bool_fix
Parse no_turbo cpu plugin option using commands.get_bool
2024-12-11 16:47:39 +01:00
Jaroslav Škarvada
d9293d7f39
Merge pull request #669 from zacikpa/ppd-adjustments
More tuned-ppd adjustments
2024-12-11 16:12:57 +01:00
Pavol Žáčik
23eb673571
tuned-ppd: Enable changing profile via function keys
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.
2024-12-03 15:40:45 +01:00
Pavol Žáčik
038dceadc0
tuned-ppd: Use inotify to check for performance degradation
Instead of actively polling for changes in the relevant files,
set up inotify handlers which are invoked when the files change.
2024-12-03 15:40:45 +01:00
Pavol Žáčik
f2d4913562
tuned-ppd: Require the presence of the balanced profile
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.
2024-12-03 15:40:45 +01:00
Pavol Žáčik
2605fedf5b
tuned-ppd: Add the version property
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.
2024-12-03 15:40:45 +01:00
Pavol Žáčik
86b1b48f98
tuned-ppd: Add docstrings 2024-12-03 15:40:44 +01:00
Pavol Žáčik
d5bd033422
tuned-ppd: Keep track of active and base profile
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.
2024-12-03 15:40:05 +01:00
Pavol Žáčik
79547f093f
tuned-ppd: Fix UPower signal handler initialization
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.
2024-12-03 15:13:16 +01:00
Jaroslav Škarvada
90c24eea03
new release (2.24.1)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2024-11-26 13:52:17 +01:00
Jaroslav Škarvada
3c3d1b21a1
Add variables to BLS entries only if grub is used
The bootloader plugin needs patched BLS entries with the TuneD variables.
It seems variables in the BLS entries is grub extension which is not
described in the BLS specification. It can cause boot problems with e.g.
systemd-boot, thus add variables to BLS entries only if the BLS entries
were generated by grub.

Resolves: rhbz#2323514

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2024-11-05 00:56:12 +01:00
Jaroslav Škarvada
83e2c88f65
powertop2tuned: use default user profile path from the consts
Fixes #701

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2024-11-03 23:07:38 +01:00
Jaroslav Škarvada
35eed3ca3e
Merge pull request #665 from yarda/spec-profile-paths-macro
spec: used macro for profiles path and other fixes
2024-10-16 12:02:10 +02:00
Jaroslav Škarvada
7a419499b1
spec: used macro for profiles path and other fixes
- 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>
2024-10-16 11:13:28 +02:00
Jaroslav Škarvada
8570e80802
Merge pull request #663 from adriaan42/adriaan/no-tuna
realtime: remove leftover use of tuna
2024-10-14 14:39:10 +02:00
Pavol Žáčik
60d819e87a
tuned-ppd: Use effective hold profile when adding profile holds
To behave the same as power-profiles-daemon, the power-saver
profile holds should have priority even if performance holds
were added later.
2024-10-14 09:43:11 +02:00
Pavol Žáčik
261efaa8b5
Bump doc/manual revision date and number 2024-10-11 12:45:21 +02:00
Pavol Žáčik
e68382e1fb
Clean up plugin docstrings 2024-10-11 12:45:20 +02:00
Pavol Žáčik
71b41394e2
Add a script for generation of plugin docs from docstrings
The script simply joins an introduction text with the
docstrings of all plugin classes.
2024-10-11 12:45:20 +02:00
Pavol Žáčik
9935a951e9
scheduler: Do not assume that perf events have type attribute
The perf.evlist.read_on_cpu function may return instances of
classes that do not have the type attribute, e.g. perf.lost_event.
Make sure we do not read the type attribute if we are not sure
that it exists.

Resolves: RHEL-60898
2024-09-30 15:23:33 +02:00
dufuhang
ae2cfd52e8 Fix the error in the raise statement of check_positive()
1. In the raise statement of the check_positive() function, the error message conflicts with the if condition.
2. If the value of val is 0, it passes the if condition but raises an error message stating [0 has to be >= 0].
3. This PR removes the = from the raise statement, so when val is 0,
it will correctly prompt that the value of val [has to be > 0].

Signed-off-by: dufuhang <dufuhang@kylinos.cn>
2024-09-14 16:49:51 +08:00
Adriaan Schmidt
a7aa2ab4b9 fix: expand variables in Plugin._verify_all_device_commands
Need to expand variables before calling the @command function. This is
actually done for _execute_all[_non]_device_commands and
_verify_all_non_device_commands, but not in _verify_all_device_commands.
This adds the missing expansion.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
2024-09-11 09:42:50 +02:00
Georg Sauthoff
e8e3f5cf29 Allow shared service drop-in directory
Systemd reads all conf files from a service drop-in directory and merges
them.

This change enables the following use case:

Tuning unrelated but local changes can be put into - say:

    /etc/systemd/system/sfptpd.service.d/local.conf

while a simple tuning such as the process affinity mask is rolled out
via a tuned profile, like this:

`tuned.conf` snippet:

```
[service]
service.sfptpd=,file:${i:PROFILE_DIR}/tuned-sfptpd.conf
```

`tuned-sfptpd.conf`:

```
[Service]
CPUAffinity=32
```

---

Arguably, this is a natural change, i.e. it establishes symmetry in
`cfg_install()` to `cfg_uninstall()`, because `cfg_uninstall()` already
allows for the service drop-in directory not being empty.
2024-08-30 11:48:40 +02:00
Evgeni Golov
9e9771b8c7 drop support for cpuspeed
cpuspeed has not been in Fedora since 2011 [1] and last time in RHEL 6.

it should be fairly safe to drop support for it now

[1] https://bugzilla.redhat.com/show_bug.cgi?id=713572
2024-08-23 20:38:00 +02:00
Pavol Žáčik
3e98b30178
Parse no_turbo cpu plugin option using commands.get_bool
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
2024-08-22 14:30:28 +02:00
Jaroslav Škarvada
c082797fd0
Merge pull request #672 from AdamWill/set-on-battery-before-switch-profile
controller init: set _on_battery before switching profile
2024-08-19 16:06:47 +02:00
Adam Williamson
18313432e0 controller init: set _on_battery before switching profile
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>
2024-08-15 13:14:58 -04:00
Jaroslav Škarvada
0a85d3c85b
new release (2.24.0)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2024-08-07 22:09:40 +02:00
Jaroslav Škarvada
4eee2fe930
Merge pull request #666 from zacikpa/repo-remove-old-plugins
Clear plugin repository when stopping tuning
2024-08-07 20:35:06 +02:00