Implement active resource management in GNOME
Project name:
Mentors:
Description:
GNOME uses systemd to run each application in a different cgroup. The underlying technology allows us to define resource allocations on various levels. We already have some fixed definitions to e.g. prefer session critical processes, however all user applications are still put into the same bucket.
In this project, we want to introduce resource management for applications in GNOME. On the technical level, this means dynamically modifying the properties of the running systemd units. Internally however, we will need to properly track various pieces of information in order to be able to make policy decisions.
As a first step, a proof of concept should be written that tracks the currently open window in gnome-shell and increase the IO/CPU weight in systemd for the focused application.
As the next step, we should move the policy decision into gnome-settings-daemon
. This will work by setting extended attributes on the cgroup directory for each application and watching this using inotify from gnome-settings-daemon
(gsd-power
component). For a start, we will just store the last time that the application has lost focus in order to integrate with gnome-shell.
Once we have this basic structure in place, we can extend the approach to encompass more information. Here the student will be able to contribute their own ideas and experiment further.
Ideas for experimentation:
- Use information on whether the application is using audio (pipewire integration)
- Read hints from
.desktop
file in order to make more policy decisions - Set low CPU limits and watch CPU pressure information to detect background applications draining the battery
- Change
power-profiles-daemon
performance mode in certain situations - Add integration with systemd/systemd-oomd in order to show notifications when an application was killed due to OOM
Requirements:
- Languages: C, JavaScript
- Some understanding of DBus, systemd and cgroups is useful
Background reading:
Communication:
- IRC/Matrix: #gnome-hackers:gnome.org and #gnome-shell:gnome.org