• Stars
    star
    473
  • Rank 89,708 (Top 2 %)
  • Language
    Rust
  • License
    Mozilla Public Li...
  • Created over 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto-configure CFS and process priorities for improved desktop responsiveness

System76 Scheduler

Scheduling service which optimizes Linux's CPU scheduler and automatically assigns process priorities for improved desktop responsiveness. Low latency CPU scheduling will be activated automatically when on AC, and the default scheduling latencies set on battery. Processes are regularly sweeped and assigned process priorities based on configuration files. When combined with pop-shell, foreground processes and their sub-processes will be given higher process priority.

These changes result in a noticeable improvement in the experienced smoothness and performance of applications and games. The improved responsiveness of applications is most noticeable on older systems with budget hardware, whereas games will benefit from higher framerates and reduced jitter. This is because background applications and services will be given a smaller portion of leftover CPU budget after the active process has had the most time on the CPU.

Install

Requires dependencies as defined in the debian/control file:

  • cargo & rustc
  • clang
  • just
  • libclang-dev
  • libpipewire-0.3-dev
  • pkg-config

Then the included justfile can be used to build and install:

just execsnoop=$(which execsnoop-bpfcc) build-release
sudo just sysconfdir=/usr/share install

DBus

  • Interface: com.system76.Scheduler
  • Path: /com/system76/Scheduler

The SetForeground(u32) method can be called to change the active foreground process.

Scheduler Config

The configuration file is stored at the following locations:

  • System: /etc/system76-scheduler/config.kdl
  • Distribution: /usr/share/system76-scheduler/config.kdl

Presence of the system configuration will override the distribution configuration. The documented default configuration can be found here.

Note that if the background and foreground assignment profiles are defined, then foreground process management will be enabled. Likewise, if a pipewire profile is defined, then pipewire process monitoring will be enabled.

Process Priority Assignments

In addition to config.kdl, additional process scheduling profiles are stored in:

  • User-config: /etc/system76-scheduler/process-scheduler/
  • Distribution: /usr/share/system76-scheduler/process-scheduler/

An example configuration is provided here. It is parsed the same as the assignments and exceptions nodes in the main config, and profiles can inherit values from the previous assignment of the same name.

Profile

assignments {
    {{profile-name}} {{profile-properties}}
}

The profile-name can refer to any name of your choice. If the name matches a previous assignment, it will inherit the values from that assignment, plus any additional profile properties assigned.

The profile-properties may contain any of

  • Niceness priority, defined as nice=-20 through nice=19

  • A scheduler policy defined as one of:

    • sched="batch"
    • sched="idle",
    • sched="other"
    • sched=(fifo)1 through sched=(fifo)99
    • sched=(rr)1 through sched=(rr)99

Realtime scheduler policies assign a priority level between 1 and 99. Higher values have higher priority. It is recommended not to set a higher priority than hardware IRQs (>49)

  • An I/O priority defined as one of
    • io="idle"
    • io=(best-effort)0 through io=(best-effort)7
    • io=(realtime)0 through io=(realtime)7

The best-effort and realtime classes have priority levels between 0 and 7, where 7 has the least priority, and 0 is the highest priority

Assignments

Each child element of a profile defines th process(es) to assign to the profile.

{{profile-name}} {{profile-properties}} {
    "/match/by/cmdline" {{profile-properties}}
    match-by-name {{profile-properties}}
    * {{condition-properties}} {{profile-properties}}
}
  • A node name starting with a / is a match by command line path
  • A node name otherwise is a match by process name
  • * matches all processes, used with additional condition-properties
    • properties are wild-match'd
    • properties may start with ! to exclude results matching the condition
    • cgroup="cgroup-path" matches processes by a cgroup
    • parent="name" matches processes by the process name of the parent

CPU Scheduler Latency Configurations

Default

The default settings for CFS by the Linux kernel. Achieves a high level of throughput for CPU-bound tasks at the cost of increased latency for inputs. This setting is ideal for servers and laptops on battery, because low-latency scheduling sacrifices some energy efficiency for improved responsiveness.

latency: 6ns
minimum_granularity: 0.75ms
wakeup_granularity: 1.0ms
bandwidth_size: 5us

Responsive

Slightly reduces time given to CPU-bound tasks to give more time to other processes, particularly those awaiting and responding to user inputs. This can significantly improve desktop responsiveness for a slight penalty in throughput on CPU-bound tasks.

latency: 4ns
minimum_granularity: 0.4ms
wakeup_granularity: 0.5ms
bandwidth_size: 3us

License

Licensed under the Mozilla Public License 2.0. Permissions of this copyleft license are conditioned on making available source code of licensed files and modifications of those files under the same license (or in certain cases, one of the GNU licenses). Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. However, a larger work using the licensed work may be distributed under different terms and without source code for files added in the larger work.

Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the Mozilla Public License 2.0 (MPL-2.0). It is required to add a boilerplate copyright notice to the top of each file:

// Copyright {year} {person OR org} <{email}>
// SPDX-License-Identifier: MPL-2.0

More Repositories

1

shell

Pop!_OS Shell
TypeScript
4,276
star
2

pop

A project for managing all Pop!_OS sources
Rust
2,128
star
3

cosmic-text

Pure Rust multi-line text handling
Rust
1,433
star
4

cosmic-epoch

Next generation Cosmic desktop environment
Just
1,129
star
5

cosmic

Computer Operating System Main Interface Components
JavaScript
1,066
star
6

gtk-theme

System76 Pop GTK+ Theme
SCSS
747
star
7

popsicle

Multiple USB File Flasher
Rust
520
star
8

system76-power

System76 Power Management
Rust
512
star
9

iso

Pop!_OS ISO production
Makefile
439
star
10

cosmic-comp

Compositor for the COSMIC desktop environment
Rust
368
star
11

beta

Pop!_OS Beta
353
star
12

libcosmic

WIP library for COSMIC applications
Rust
265
star
13

keyboard-configurator

Keyboard configuration UI
Rust
231
star
14

distinst

Installer Backend
Rust
207
star
15

launcher

Modular IPC-based desktop launcher service
Rust
203
star
16

tensorman

Utility for easy management of Tensorflow containers
Rust
190
star
17

cosmic-term

WIP COSMIC terminal emulator
Rust
183
star
18

cosmic-edit

COSMIC Text Editor
Rust
181
star
19

icon-theme

System76 Pop icon theme for Linux
Python
169
star
20

cosmic-applets

WIP applets for cosmic-panel
Rust
169
star
21

firmware-manager

Generic framework and GTK UI for firmware updates from system76-firmware and fwupd, written in Rust.
Rust
159
star
22

wallpapers

Wallpapers for Pop!_OS
Makefile
149
star
23

cosmic-settings

COSMIC Settings
Rust
116
star
24

nvidia-graphics-drivers

Pop!_OS NVIDIA Graphics Drivers
110
star
25

system76-driver

System76 Driver for Pop!_OS
Python
101
star
26

cosmic-panel

WIP
Rust
94
star
27

upgrade

Utility for upgrading Pop!_OS and its recovery partition to new releases.
Rust
90
star
28

cosmic-launcher

WIP
Rust
80
star
29

gnome-shell-extension-system76-power

System76 Power Management Extension
TypeScript
74
star
30

cosmic-time

Animation Library for https://github.com/iced-rs/iced and https://github.com/pop-os/cosmic-epoch
Rust
72
star
31

system76-firmware

System76 Firmware Tool and Daemon
Rust
71
star
32

cosmic-dock

Pop!_OS fork of https://github.com/micheleg/dash-to-dock/tree/ubuntu-dock
JavaScript
68
star
33

fonts

Fonts for the System76 Pop look, Fira and Roboto Slab
Makefile
68
star
34

tiler

Generic tiling window manager library in Rust
Rust
65
star
35

pop-arm64

Experimental scripts for building an Pop!_OS for ARM64 EFI platforms.
Shell
59
star
36

core

WIP immutable base
Rust
55
star
37

shell-shortcuts

Application for displaying and demoing Pop Shell shortcuts
Rust
53
star
38

debrepbuild

A project for automatically generating and maintaining Debian repositories from a TOML spec.
Rust
53
star
39

cosmic-session

Session manager for the COSMIC desktop environment
Rust
44
star
40

theme

A metapackage including pop-fonts, pop-gtk-theme, and pop-icon-theme
42
star
41

desktop-widget

Pop Desktop Settings Widget
Fluent
41
star
42

cosmic-files

WIP COSMIC file manager
Rust
38
star
43

cosmic-applibrary

WIP
Rust
37
star
44

touchegg

Pop!_OS fork of https://github.com/JoseExposito/touchegg
C++
36
star
45

async-fetcher

Rust crate for asynchronous file fetching, using optional fetching based on modified times and checksums
Rust
36
star
46

system76-dkms

System76 DKMS driver
C
36
star
47

sys-mount

High level FFI binding around the sys mount & umount2 calls, for Rust
Rust
36
star
48

url-scraper

Rust crate for scraping URLs from HTML pages
Rust
36
star
49

gnome-shell-theme

The GNOME Shell theme for Pop!_OS
CSS
35
star
50

default-settings

Distribution Default Settings
Shell
35
star
51

cosmic-workspaces

Pop!_OS fork of https://github.com/RensAlthuis/vertical-overview
JavaScript
32
star
52

cosmic-store

WIP COSMIC app store
Rust
32
star
53

linux-firmware

Pop!_OS fork of https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux-firmware
C
29
star
54

cosmic-greeter

libcosmic greeter for greetd, which can be run inside cosmic-comp
Rust
29
star
55

gnome-control-center

Pop!_OS fork of https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/gnome-control-center
C
27
star
56

buildchain

Software for creating and managing a distributed and reproducible chain of builds
Rust
27
star
57

system-updater

Systemd services for checking for and applying system updates.
Rust
27
star
58

pidfd

Rust crate providing Linux (>= 5.3) PID file descriptor support
Rust
27
star
59

website

The Pop!_OS website
Vue
27
star
60

bus-writer

Single-reader, multi-writer & single-reader, multi-verifier; broadcasts reads to multiple writeable destinations in parallel
Rust
27
star
61

desktop

Desktop metapackage
25
star
62

system76-oled

Control brightness on OLED displays
Rust
24
star
63

xdg-desktop-portal-cosmic

Rust
23
star
64

libparted

Rust wrappers for libparted
Rust
22
star
65

gnome-shell-extension-do-not-disturb

Enable or disable do not disturb mode.
JavaScript
21
star
66

gnome-shell

Pop!_OS fork of https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/gnome-shell
C
21
star
67

theme-switcher

Pop!_OS GTK widget library / app for switching themes
Rust
20
star
68

progress-streams

Rust crate to extend io::Read & io::Write types with progress callbacks
Rust
19
star
69

freedesktop-desktop-entry

Rust crate for navigating Freedesktop desktop entries
Rust
19
star
70

cosmic-theme-editor

WIP
Rust
19
star
71

sysfs-class

Rust library for viewing /sys/class in an object-oriented format
Rust
18
star
72

system76-wallpapers

System76 Wallpapers
17
star
73

plymouth-theme

Plymouth splash screen themes
Shell
17
star
74

systemd-boot-conf

Rust crate for managing the systemd-boot loader configuration.
Rust
17
star
75

cosmic-protocols

Addtional wayland-protocols used by the COSMIC desktop environment
Rust
17
star
76

repo-release

Produces Pop release package repositories
Shell
16
star
77

dbus-udisks2

Rust library for interacting with the UDisks2 DBus API
Rust
16
star
78

cosmic-settings-daemon

Rust
16
star
79

system76-acpi-dkms

System76 ACPI Driver (DKMS)
C
15
star
80

cosmic-osd

Rust
15
star
81

gtk-extras

Rust crate containing an assortment of extra, unofficial GTK patterns, widgets, and traits.
Rust
13
star
82

proc-mounts

Rust crate for fetching active mounts and swaps on a Linux system
Rust
13
star
83

as-result

Rust crate which provides the `AsResult<T, E>` and `IntoResult<T, E>` traits.
Rust
13
star
84

debarchive

Rust crate which provides direct access to files within a Debian archive
Rust
13
star
85

mutter-rs

Rust wrappers for Mutter and related projects
Rust
13
star
86

os-release

Rust crate for parsing the /etc/os-release file, common with Linux distributions
Rust
13
star
87

cosmic-randr

Library and utility for displaying and configuring Wayland outputs
Rust
13
star
88

cosmic-player

WIP COSMIC media player
Rust
12
star
89

grub-theme

Grub bootloader theme
12
star
90

cog-stable-diffusion

Packaging for convenience of installation and setup of stable diffusion on Pop
Python
12
star
91

cosmic-theme

WIP
Rust
12
star
92

cosmic-screenshot

Utility for capturing screenshots via XDG Desktop Portal
Rust
12
star
93

repo-curated-free

APT repository configuration for building an apt repository with only free software.
11
star
94

iced-sctk

WIP
Rust
11
star
95

cosmic-notifications

Rust
11
star
96

cosmic-workspaces-epoch

Rust
11
star
97

partition-identity

Find the ID of a device by its path, or find a device path by its ID.
Rust
11
star
98

repolib

Python library for managing APT sources
Python
11
star
99

hp-vendor

Vendor support for HP products using Pop!_OS
Rust
10
star
100

snapshot

A utility for taking btrfs snapshots of Pop!_OS installs
Rust
10
star