1
0
Fork 0
Commit graph

2083 commits

Author SHA1 Message Date
Pavol Žáčik
64166c5f5e
functions: Create a new parser object for each string expansion
Previously, the parser state would be shared, creating races
when two threads would attempt to expand functions in strings
at the same time (e.g., when a device was hotplugged during
TuneD initialization).

The change requires minor refactoring: the function `Repository`
class is now the one providing the expansion API to the `Variables`
class instead of the original `Functions` class (now renamed to
`Parser` and newly created for each expansion).

Resolves: RHEL-75773
2025-01-23 09:40:54 +01:00
Pavol Žáčik
f4c52cd05b
utils: Rename PluginLoader to ClassLoader
The `PluginLoader` class is used as an interace implemented by
all kinds of repositories: of profile plugins, functions, monitors.
While these are all technically "plug-in", the naming is confusing.

The commit also updates the `load_all_plugins` method of the class
(now `load_all_classes`) to use the class loader parameters
(prefix, namespace) instead of hardcoded ones.
2025-01-23 09:40:29 +01:00
Jaroslav Škarvada
7480983aed
new release (2.25.0-rc.1)
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-19 18:48:14 +01:00
Jaroslav Škarvada
b36960bce3
Merge pull request #730 from yarda/RHEL-60906-fix-scheduler
plugin_scheduler: fixed API
2025-01-19 17:42:33 +01:00
Jaroslav Škarvada
300444b236
docs: fixed docs generation on centos-7
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-18 22:48:44 +01:00
Jaroslav Škarvada
42c3837f40
plugin_scheduler: fixed API
It's fixing hidden conflict caused by #725 and #728 which were merged
without rebase.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-18 20:45:30 +01:00
Jaroslav Škarvada
40588f60e8
Merge pull request #729 from yarda/bin-sbin-merge-fix
makefile: added support for installation to custom $BINDIR/$SBINDIR
2025-01-18 19:58:43 +01:00
Jaroslav Škarvada
0f1e4a45a2
Merge pull request #728 from yarda/RHEL-60906
plugin_net: added support for hotplug and rename
2025-01-18 19:58:18 +01:00
Jaroslav Škarvada
0b82ce0c9b
Merge pull request #727 from zacikpa/hold-clearing-fix
tuned-ppd: Fix handling of profile change signals from TuneD
2025-01-18 19:56:04 +01:00
Jaroslav Škarvada
dee3b407c6
Merge pull request #718 from yarda/rhel_enable_docs
doc: enable documentation generation on RHEL with asciidoc
2025-01-18 19:55:00 +01:00
Jaroslav Škarvada
e264ee1fac
Merge pull request #716 from yarda/perf-optional
plugin_scheduler: make perf support optional
2025-01-18 19:54:34 +01:00
Jaroslav Škarvada
2a1bb41220
Merge pull request #717 from zacikpa/affinity-error-logs
scheduler: Log process info when its affinity cannot be changed and re-check blacklisted cgroups
2025-01-18 19:52:34 +01:00
Jaroslav Škarvada
13dfc68b85
Merge pull request #725 from yarda/scheduler-tunables-changes
scheduler: updated sched knobs for kernels 6.6+
2025-01-16 22:24:37 +01:00
Jaroslav Škarvada
edee85a35f
Merge pull request #700 from lack/lenient_kvm_script
Do not initialize kvm low latency if kvm not present
2025-01-16 22:14:00 +01:00
Jaroslav Škarvada
b8392f9932
Merge pull request #715 from ruihe774/raw_epp
plugin_cpu: allow raw energy_performance_preference values
2025-01-16 22:08:18 +01:00
Jaroslav Škarvada
9535b07cbe plugin_scheduler: make perf support optional
Requested in: https://src.fedoraproject.org/rpms/tuned/pull-request/8

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-16 21:57:41 +01:00
Jaroslav Škarvada
6def0e44cf
plugin_net: added support for hotplug and rename
This will not completely resolve RHEL-60906, because there will be
always race condition if the rename event happens before the instance
is fully initialized, but it should significantly improve the situation.

Drawback is that it can report in the logs device names that shouldn't
be matched by the plugin_net instance, i.e. it matches devices according
to their original names but accesses them with their new names. This
can be confusing. Also in the runtime API (e.g. for removal of the
device from the instance), the original device names have to be used.
For insertion of the device to the instance, new names have to be used.
This can be even more confusing.

Unfortunately, there probably isn't better alternative now, because
for correct operation we would have to handle rename by removal and
addition events. This would require rollback and retune steps which would
lead to very negative performance consequences. Also we would have to
cope with partially tuned devices if the rename event happens during
profile application. It's doable, but it would require big
architectural changes.

The PR also extends internal API, now the plugin instances receive
'instance' as a method parameter.

Also fixed some existing CodeQL warnings.

Resolves: RHEL-60906

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-16 18:40:41 +01:00
Pavol Žáčik
7113c91b5b
scheduler: Postpone cgroup blacklist check and double-check after fail
It may happen that a process gets moved into a blacklisted cgroup
when TuneD is already applying a profile. Postpone the filtering of
processes according to the blacklist to the last possible moment to
minimize the race window.

When setting process affinity fails, re-check whether the process
belongs to a blacklisted cgroup once again and do not report an
error if that's the case.

Resolves: RHEL-72981
2025-01-16 13:44:09 +01:00
Jaroslav Škarvada
84f4d122e9
makefile: added support for installation to custom $BINDIR/$SBINDIR
This is required by Fedora 42 /usr/bin /usr/sbin merge.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-16 11:13:35 +01:00
Jaroslav Škarvada
cc168b9782
Merge pull request #712 from zacikpa/ppd-python-compat
tuned-ppd: Remove the use of StrEnum
2025-01-16 01:58:48 +01:00
Pavol Žáčik
0306b05300
tuned-ppd: Remove the use of StrEnum
To be compatible with Python 3.9.

Resolves: RHEL-68208
2025-01-15 10:16:04 +01:00
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
Pavol Žáčik
f4546e5ab6
tuned-ppd: Do not always clear holds with TuneD profile change signal
The signal is received even when the profile change originates within
tuned-ppd. We cannot reliably detect that is the case, so do not
clear profile holds if the signalled profile corresponds to the
currently active one.
2025-01-14 15:33:07 +01:00
Pavol Žáčik
17c58c55e8
tuned-ppd: Check that TuneD profile change signal is relevant
If there are multiple profile switches coming closely after
each other, all signals excepts the last one (with the current
TuneD profile) are not relevant anymore and should be ignored.
2025-01-14 15:31:06 +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
Jaroslav Škarvada
87ff27c8ca
scheduler: updated sched knobs for kernels 6.6+
sched_wakeup_granularity_ns - removed
sched_min_granularity_ns    - now sched_base_slice_ns, same units and scale
sched_latency_ns            - removed

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-12 18:16:33 +01:00
Jaroslav Škarvada
f3155f19fc
doc: enable documentation generation on RHEL with asciidoc
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2024-12-11 23:08:51 +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
55e272e263
scheduler: Log process info when its affinity cannot be changed
Include its current affinity, cmdline, and cgroup. This may help
identify issues with tuning, e.g., in cases when the process
disappears soon after affining it fails.

Resolves: RHEL-69933
2024-12-06 10:36:34 +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