1
0
Fork 0
Commit graph

2243 commits

Author SHA1 Message Date
Jaroslav Škarvada
08d03e0bf4
Merge pull request #739 from zacikpa/sap-hana-hugepages
sap-hana: Set transparent_hugepages to madvise
2025-01-29 22:43:39 +01:00
Jaroslav Škarvada
54f434e3cf
Merge pull request #738 from ycongal-smile/grub_export
bootloader: export Grub variables to make them available in submenus
2025-01-29 22:43:23 +01:00
Jaroslav Škarvada
8b17fe9d09
Merge pull request #733 from marcan/fix-cpu-online
utils.commands: Fix CPU online detection when not present
2025-01-29 22:34:20 +01:00
Jaroslav Škarvada
5452adada6
Merge pull request #736 from rtzoeller/cqe-mode-rx
plugin_net: handle cqe-mode-rx ethtool option
2025-01-29 22:02:13 +01:00
Jaroslav Škarvada
263f51c8e1
Merge pull request #732 from marcan/fix-cpu-governors
profiles: Correct CPU governor settings
2025-01-29 22:01:26 +01:00
Pavol Žáčik
579cddc7e2
sap-hana: Set transparent_hugepages to madvise
Resolves: RHEL-68454
2025-01-29 13:26:15 +01:00
Yoann Congal
e9f0f228b3 bootloader: export Grub variables to make them available in submenus
Without exporting the grub variables, they are only available in the
main grub menu[0]. When descending in a submenu (like in default Debian for
example), tuned_* variable are expanded to the empty string and, so,
tuned kernel cmdline tuning is effectively disabled.

With the export, variables are available in submenus and tuned tuning is
applied as expected.

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1094201#10

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
2025-01-27 11:59:21 +01:00
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
Ryan Zoeller
cbaec70ad9 plugin_net: handle cqe-mode-rx ethtool option
Parsing ethtool output has been broken for several years, since `ethtool -c`
started producing a line resembling `CQE mode RX: n/a  TX: n/a`.
This prevents setting any [net] coalesce= options, which log
`tuned.plugins.plugin_net: unknown coalesce parameter(s): {'CQE mode RX'}`.

Substituting `cqe-mode-rx:` for `CQE mode RX:` resolves the issue,
although there is a conflict with the `adaptive-tx` workaround
which prevents us from supporting `cqe-mode-tx` directly.
Do not attempt to address that issue as part of this change.

Fixes #726.

Signed-off-by: Ryan Zoeller <ryan.zoeller@aliaro.com>
2025-01-22 15:37:00 -06:00
Hector Martin
e24bfef651 profiles: Correct CPU governor settings
First, always prefer schedutil for balanced/powersave. On platforms
where this governor is available, this enables Energy-Aware-Scheduling
which offers the best power efficiency and performance combination.
There is absolutely no reason to use another governor by default in the
"balanced" profile on these systems, in particular.

Second, swap around "conservative" and "ondemand". "conservative" is
supposed to be lower power and higher latency. The commit that made this
change [1] tested on a single server platform (10 years ago), but came
to the wrong conclusion. Dividing the throughput by power numbers of
that commit, "conservative" did in fact provide better performance/watt,
which is the intent of lower-power modes. The fact that it also
happened to provide better overall performance than "ondemand" is
probably an artifact of suboptimal power-management behavior or a
flawed test.

[1] b2897d9c1c

Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-21 08:31:13 +09:00
Hector Martin
13dc68447d utils.commands: Fix CPU online detection when not present
Not all platforms can offline CPUs. On those that can't, there is no
"online" attribute. Default to online in that case.

Signed-off-by: Hector Martin <marcan@marcan.st>
2025-01-21 08:15:39 +09: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