[MIR] tuned

Bug #1988066 reported by Joseph Salisbury
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tuna (Ubuntu)
Invalid
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned
tuned (Ubuntu)
Expired
High
Unassigned
Jammy
Expired
High
Unassigned

Bug Description

== Overview ==
TuneD is a system tuning service for Linux. It:
* monitors connected devices using the udev device manager

* tunes system settings according to a selected profile

* supports various types of configuration like sysctl, sysfs, or kernel
boot command line parameters, which are integrated in a plug-in architecture

* supports hot plugging of devices and can be controlled from the command line or through D-Bus, so it can be easily integrated into existing administering solutions: for example, with Cockpit

* can be run in no-daemon mode with limited functionality (for example, no support for D-Bus, udev, tuning of newly created processes, and so on) for systems with reduced resources

* stores all its configuration cleanly in one place – in the TuneD profile – instead of having configuration on multiple places and in custom scripts

TuneD profiles:
* can be defined hierarchically, which reduces duplication and simplifies maintenance: More specialized profiles can inherit generic profiles and just change what is needed instead of duplicating the code. For example, you can built a generic profile for HTTP server upon the throughput-performance profile and later create two more specialized profiles for the Apache server and the Nginx server, basing both profiles on the generic HTTP server profile.

* support full rollback: The system can be easily returned to the state before the profile was applied. This can be handy for testing, benchmarking, experimenting, and so on. For example, you can set up a cron rule to apply a certain profile during business hours and a different one at night.

* include a number of predefined profiles for common use cases:
  For example, presets for high throughput, low latency, or powersave are distributed. Profiles optimizing performance for various products like SAP, dBase servers, and so on are also provided, and it is possible to fully customize them.

[ See https://github.com/redhat-performance/tuned]

== Answers to UbuntuMainInclusionRequirements ==

= Requirements =

1. Availability
* Package is in universe: https://launchpad.net/ubuntu/+source/tuned
  However, there is another separate package in LP with the same name:
   https://launchpad.net/tuned
* The version of tuned in Universe for Jammy is 2.15. However, we are requesting version 2.18 due to known bugs in 2.15 that are fixed in 2.18.

2. Rationale
* The tuned package contains a daemon that tunes system settings dynamically. It does so by monitoring the usage of several system components periodically. Tuned allows users to select profiles based on workloads, one being real-time. A user can enable the real-time profile, which has shown to reduce latencies.

* The tuned package is already in use by end users running CentOS and looking to move to Ubuntu.

* Example of using the real-time profile compared to default Ubuntu real-time kernel. Notice the last column, which is the max latency:

Ubuntu without tuned:
T:82 ( 4435) P:80 I:200 C: 449 Min: 7 Act: 9 Avg: 8 Max: 24
T:83 ( 4436) P:80 I:200 C: 434 Min: 7 Act: 9 Avg: 10 Max: 83
T:84 ( 4437) P:80 I:200 C: 420 Min: 8 Act: 12 Avg: 10 Max: 27
T:85 ( 4438) P:80 I:200 C: 405 Min: 7 Act: 8 Avg: 12 Max: 108
T:86 ( 4439) P:80 I:200 C: 391 Min: 7 Act: 8 Avg: 8 Max: 23

realtime profile with assigned IRQ affinity:
T:82 ( 4728) P:80 I:200 C: 180 Min: 2 Act: 2 Avg: 2 Max: 3
T:83 ( 4729) P:80 I:200 C: 166 Min: 2 Act: 2 Avg: 2 Max: 3
T:84 ( 4730) P:80 I:200 C: 152 Min: 2 Act: 2 Avg: 2 Max: 3
T:85 ( 4731) P:80 I:200 C: 139 Min: 2 Act: 2 Avg: 2 Max: 3
T:86 ( 4732) P:80 I:200 C: 125 Min: 2 Act: 2 Avg: 2 Max: 3

3. Security:
* The only security issues found in the NVD are for versions 2.10 and older. Tuned is Universe is currently 2.15.

4. Quality assurance:
   * Manual is provided
   * No debconf questions higher than medium
   * No major outstanding bugs.

Bugs outstanding:
1713313 Unable to launch pkexec'ed applications on Wayland session
1774000 Fails to boot cirros QEMU image with tuned running
1838063 not start "tuned-gui"
1850228 tuned-gui fails to run on at least 19.04 and 19.10
1925765 [21.04 regression] tuned breaks networking in podman containers

   * Exotic Hardware: N/A
   * No Test Suite shipped with the package
   * Does not rely on obsolete or demoted packages

5. UI standards:
 * This is a CLI tool. Tool has normal CLI style short help and man pages

* No desktop file required as it is a CLI tool.

6. Binary Dependencies (Reported by check-mir):

# check-mir for TUNED:
Checking support status of build dependencies...
 * debhelper-compat does not exist (pure virtual?)
 * dh-python binary and source package is in universe

Checking support status of binary dependencies...
 * ncat binary and source package is in universe
 * python3-linux-procfs binary and source package is in universe
 * virt-what binary and source package is in universe
 * linux-cpupower does not exist (pure virtual?)
 * tuned binary and source package is in universe
 * tuned binary and source package is in universe
 * systemtap binary and source package is in universe
 * tuned binary and source package is in universe

# check-mir for TUNA:
Checking support status of build dependencies...
 * debhelper-compat does not exist (pure virtual?)
 * dh-python binary and source package is in universe

Checking support status of binary dependencies...
 * python3-ethtool binary and source package is in universe
 * python3-linux-procfs binary and source package is in universe

# TUNED
# Installed tuned on a VM and these are the reported dependencies:
$ sudo apt-get install tuned
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ethtool gawk libsigsegv2 ncat python3-configobj python3-decorator python3-linux-procfs python3-pyudev
  virt-what
Suggested packages:
  gawk-doc python-configobj-doc
Recommended packages:
  linux-cpupower
The following NEW packages will be installed:
  ethtool gawk libsigsegv2 ncat python3-configobj python3-decorator python3-linux-procfs python3-pyudev tuned
  virt-what

## TUNA:
$ sudo apt-get install tuna
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  python3-ethtool
The following NEW packages will be installed:
  python3-ethtool tuna
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 217 kB of archives.
After this operation, 630 kB of additional disk space will be used.

7. Standards compliance:
 * FHS + Debian Policy standards to the best of my knowledge

8. Maintenance
 * Package owning team: The Ubuntu Kernel Team
 * Debian package maintained by: Evgeni Golov, <email address hidden>

9. Background Information
* The Package descriptions explains the package well
  Link to upstream project: https://tuned-project.org/

CVE References

description: updated
Changed in tuned (Ubuntu):
importance: Undecided → High
no longer affects: tuna (Ubuntu)
Changed in tuned (Ubuntu Jammy):
importance: Undecided → High
Changed in tuna (Ubuntu):
assignee: nobody → Ioanna Alifieraki (joalif)
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Hello Joseph, can you please explain the relationship between these packages and tlp and gamemode, both of which offer similar functionality are already in main?

Thanks

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Hi Seth,

The tuned and tuna packages have been used in CentOS production environments for some time, so they are tried and tested. Also, tuned is used specifically by partners in their FlexRAN software.

I will investigate tlp and gamemode and see if they could be used as an alternative.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks Joseph, but what Seth wanted was for example:

[16:37] <cpaelzer> sarnold: is your question of the relationship between those sufficiently answered?
[16:37] <sarnold> cpaelzer: not really, it'd be nice to hear something specific that it does that the others cannot do

That will be part of the MIR check, "are there other things already doing that".
So putting a clear explanation why we need this one will be required sooner or later anyway.

So if you could go more in detail what it provides that others can not it would be great.
You said: "I will investigate tlp and gamemode and see if they could be used as an alternative." let us know the outcome once ready.

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Hi Joshep,

Could you please fill in the template found in [1] for the tuna package ?
Tuna and tuned are two different source package and therefore a template for each
is required.

I looked at the tuna package and I would suggest you pay extra attention to the
following items when you fill in the template, as they are required by the MIR team
for the package to be promoted to main :

1. The current upstream release is 0.18. The packaged version in debian and ubuntu is 0.15.
MIR team requires for the latest version to be packaged [2], that mean bumping the version in
debian and ubuntu/kinetic.

2. Currently there are no test running either at build time or as autopackage. Again having tests
running at build time and as autopackage is a requirement [3] (can be the same set of tests).

3. While looking into tuna I found out that it does not work well after install (look at lp bug 1988848 [4])
which is also a requirement [5].

[1] https://github.com/canonical/ubuntu-mir/#main-inclusion-requirements
[2] https://github.com/canonical/ubuntu-mir#reviewing-a-bug , section [Packaging red flags]
[3] https://github.com/canonical/ubuntu-mir/#main-inclusion-requirements , section [Quality assurance - testing]
[4] https://bugs.launchpad.net/ubuntu/+source/tuna/+bug/1988848
[5] https://github.com/canonical/ubuntu-mir/#main-inclusion-requirements , section [Quality assurance - function/usage]

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Joshep.

I’m holding up on the tuned review specifically until we have what Ioanna requested for Tuna, as the same can applky to tuned:
- the latest version (0.19) is not packaged, the current archive one is kind of old (0.15) which shows low commitment in term of following latest version
- lack of autopkgtests execution is impacting tuned too, which is a requirement.
- need an answer on duplication with existing technologies in main.

Until then, I’m setting the bug as incomplete. Feel free to revert the status once tuna/tuned points are adressed.

Changed in tuned (Ubuntu):
status: New → Incomplete
Changed in tuned (Ubuntu Jammy):
status: New → Incomplete
Changed in tuna (Ubuntu):
status: New → Incomplete
Changed in tuna (Ubuntu Jammy):
status: New → Incomplete
Changed in tuna (Ubuntu):
assignee: Ioanna Alifieraki (joalif) → nobody
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I experimented and tested with tlp and gamemode. Unfortunately neither of those packages provide the functionality that tuned does.

For example, one key feature of tuned is the ability to create isolated cores for rt processes and move kernel managed IRQs out of those isolated cores.

Another important feature of tuned is the network latency profile, which is pulled into the real-time profile. The network latency profile has 'canned' kernel parameters that have been tested and validated for real-time workloads, such as:

net.core.busy_read
net.core.busy_poll
net.ipv4.tcp_fastopen
kernel.numa_balancing

Neither tlp nor gamemode provide these types for tunings that are already tested and validated.

The tuned package is widely used in the real-time community, so having it available and supported in Ubuntu would be very beneficial.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I will gather the requested information for tuna and update the bug.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote (last edit ):

After reviewing the tuned project and code, it does not appear that tuna is a dependency for tuned.

Tuna is a tool that is a 'Nice to have', but it is not required to set tuning profiles via tuned. Having it in Universe is still acceptable, and those that want to use it can install it from that repo.

I will invalidate the tuna task for this bug.

Changed in tuna (Ubuntu):
status: Incomplete → Invalid
Changed in tuna (Ubuntu Jammy):
status: Incomplete → Invalid
Changed in tuned (Ubuntu):
status: Incomplete → Confirmed
Changed in tuned (Ubuntu Jammy):
status: Incomplete → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Re: [Bug 1988066] Re: [MIR] tuned

On Wed, Sep 14, 2022 at 7:45 PM Joseph Salisbury
<email address hidden> wrote:
>
> After reviewing the tuned project and code, it does not appear that tuna
> is a dependency for tuned.

Ok, not a dependency and eventually it is your call to make as you
need to support it.
But from the description of the PKG and mapping it to your rationale
it sounds like exactly what you want.

"""
Low-level system performance tuning for realtime systems
 Tuna is used to change the attributes of application and kernel threads, IRQs,
 CPUs, and CPU sockets. It can change scheduling policy, scheduler priority and
 processor affinity for processes and process threads. It can also change the
 processor affinity for interrupts, isolate CPUs, and spread threads or IRQs
 across CPUs.
"""

Anyway, as i said - your call - not continuing on tuna ...

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

The primary reason for the tuned request in Main is due to a partner requirement. The partner will be using the real-time kernel within their product and utilize tuned to deploy pre-defined profiles.

They way tuned is used, does not require tuna. Tuned provides similar features as tuna, but the primary difference is tuned uses static tuning mainly consisting of predefined sysctl and sysfs settings and one-shot activation of several configuration tools like ethtool. Tuna is more of a dynamic tuning tool.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Thanks for the answer! Let’s put back tuned on our list.

In parallel of myself doing the MIR review, there is still the "quite some versions behind" and "lack of build time and autopktests" which will be required before ACKing the MIR, so maybe you can have a look meanwhile?

Changed in tuned (Ubuntu):
assignee: nobody → Didier Roche-Tolomelli (didrocks)
status: Confirmed → New
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
Download full text (4.5 KiB)

Review for Package: tuned

[Summary]
Can’t decide yet if this is a MIR team ACK or NACK. There are many required TODOs to be fixed first. It seems some commands like check-mir have been run but the output wasn’t carefully looked at (all binaries have dependencies against components in universe for instance, and so, they need to be MIR too). I would appreciate that another pass is done on all MIR requirements page, and after the reread, do the required updates and actions.
Note that this will need a security review too, but I don’t think the package is at the point to assign to ubuntu-security yet.

List of specific binary packages to be promoted to main: TBD (see above)

Notes:
Required TODO:
- the list of binary package to be promoted is not listed. So I don’t know if you want all packages to be promote, like the -gtk variant or only some.
- some binary packages have dependencies against components in universe, please file a MIR about them, see the check you did in 6.
- the version is some versions behind. Especially with the "* The version of tuned in Universe for Jammy is 2.15. However, we are requesting version 2.18 due to known bugs in 2.15 that are fixed in 2.18." with no movement which doesn’t give the level of confidence that this package will be updated regularly. Please update it before we can ack the MIR
- there is no tests running during autopkgtests. Those are required for any new packages in main. Please check the MIR wiki requirements page for more information and optional fallback test plan if automating them is not possible.
- look if we ship the -gtk package that translations are presents (I might be wrong on it)
Recommended TODOs:
- multiple bugs mentions issue on starting the GUI. They are not triaged, are they still valid?

[Duplication]
There is a discussion about the possible duplication. The arguments were convincing enough and so, this is not real a duplicated of any other package in main providing the exact same functionality.

[Dependencies]
OK:
- no -dev/-debug/-doc packages that need exclusion
- No dependencies in main that are only superficially tested requiring
  more tests now.

Problems:
All binaries packages ends up with dependencies and/or recommends in universe. This needs to be rechecked, see what packages we want to promote and file MIRs where they are needed.

[Embedded sources and static linking]
OK:
- no embedded source present
- no static linking
- does not have unexpected Built-Using entries

OK:
- not a go package, no extra constraints to consider in that regard
- not a rust package, no extra constraints to consider in that regard

[Security]
OK:
- history of CVEs does not look concerning (they were promptly fixed). Note that 2.10 in focal is still impacted by one CVE (https://www.cvedetails.com/cve/CVE-2012-6136/).
- does not use webkit1,2
- does not use lib*v8 directly
- does not parse data formats (files [images, video, audio,
  xml, json, asn.1], network packets, structures, ...) from
  an untrusted source.
- does not open a port/socket
- does not process arbitrary web content
- does not use centralized online accounts
- does not integrate arbitrary javascript into the desktop
- does not deal w...

Read more...

Changed in tuned (Ubuntu):
status: New → Incomplete
assignee: Didier Roche-Tolomelli (didrocks) → nobody
Changed in tuned (Ubuntu Jammy):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for tuned (Ubuntu) because there has been no activity for 60 days.]

Changed in tuned (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for tuned (Ubuntu Jammy) because there has been no activity for 60 days.]

Changed in tuned (Ubuntu Jammy):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.