Go to file
Zbigniew Jędrzejewski-Szmek b8df7f8629 user: delegate cpu controller, assign weights to user slices
So far we didn't enable the cpu controller because of overhead of the
accounting. If I'm reading things correctly, delegation was enabled for a while
for the units with user and pam context set, i.e. for user@.service too.
a931ad47a8 added the explicit Delegate=yes|no
switch, but it was initially set to 'yes'.
acc8059129 disabled delegation for user@.service
with the justication that CPU accounting is expensive, but half a year later
a88c5b8ac4 changed DefaultCPUAccounting=yes for
kernels >=4.15 with the justification that CPU accounting is inexpensive there.

In my (very noncomprehensive) testing, I don't see a measurable overhead if the
cpu controller is enabled for user slices. I tried some repeated compilations,
and there is was no statistical difference, but the noise level was fairly
high. Maybe better benchmarking would reveal a difference.

The goal of this change is very simple: currently all of the user session,
including services like the display server and pipewire are under user@.service.
This means that when e.g. a compilation job is started in the session's
app.slice, the processes in session.slice compete for CPU and can be starved.
In particular, audio starts to stutter, etc. With CPU controller enabled,
I can start start 'ninja -C build -j40' in a tab and this doesn't have any
noticable effect on audio.

I don't think the particular values matter too much: the CPU controller is
work-convserving, and presumably the session slice would never need more than
e.g. one 1 full CPU, i.e. half or a quarter of available CPU resources on even
the smallest of today's machines. app.slice and session.slice are assigned
equal weights, background.slice is assigned a smaller fraction. CPUWeight=100
is the default, but I wrote it explicitly to make it easier for users to see
how the split is done. So effectively this should result in session.slice
getting as much power as it needs.

If if turns out that this does have a noticable overhead, we could make it
opt-in. But I think that the benefit to usability is important enough to enable
it by default. W/o something like this the session is not really usable with
background tasks.
2022-07-05 14:40:01 +02:00
.clusterfuzzlite ci: unpin CFLite 2022-04-26 09:13:57 +00:00
.github build(deps): bump meson from 0.62.0 to 0.62.2 in /.github/workflows 2022-07-01 14:36:52 +03:00
.lgtm/cpp-queries ci: pack-ify our custom CodeQL queries and enable them in Actions 2021-12-07 14:57:09 +01:00
.semaphore semaphoreci: re-enable rebooting tests 2022-04-07 14:53:49 +09:00
catalog Move message repeat 2022-06-01 00:20:30 +09:00
coccinelle coccinelle: don't try to use IN_SET() in assert_cc() 2022-05-30 18:17:11 +02:00
docs docs: move some stuff into "Networking" section 2022-07-05 11:22:06 +01:00
factory meson: also allow setting GIT_VERSION via templates 2022-04-05 22:18:31 +02:00
hwdb.d tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
LICENSES network: license all config files as CC0 2022-01-12 16:05:59 +01:00
man tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
mkosi.default.d mkosi: drop libiptc from build for Fedora 2022-05-13 04:21:27 +09:00
modprobe.d meson: install the right README file in modprobe.d 2021-07-07 14:52:05 +02:00
network network: add example file that enables DHCP on ethernet links 2022-01-12 16:05:59 +01:00
po po: add a false positive to POTFILES.skip 2022-06-27 22:59:26 +09:00
presets units: enable systemd-network-generator by default 2021-12-16 09:49:39 +01:00
rules.d meson: install 70-power-switch.rules 2022-05-19 05:04:58 +09:00
shell-completion Use https for gnu.org 2022-06-28 16:07:35 +02:00
src tree-wide: Remove the repeated ';' from code (#23901) 2022-07-05 16:06:47 +09:00
sysctl.d tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
sysusers.d Use descriptive name for nobody 2022-05-27 22:09:24 +01:00
test tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
tmpfiles.d meson: Sort lines in tmpfiles.d/meson.build 2022-05-03 20:46:16 +02:00
tools meson: Switch default-locale default to C.UTF-8 2022-06-04 05:08:37 +09:00
units user: delegate cpu controller, assign weights to user slices 2022-07-05 14:40:01 +02:00
xorg xorg/50-systemd-user: add a full license header 2021-10-01 14:45:00 +02:00
.clang-format clang-format: Adjust style of pointers 2022-05-30 04:00:54 +09:00
.ctags editors: Prevent ctags from following symlinks 2019-02-15 11:01:20 -08:00
.dir-locals.el scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.editorconfig docs: configure editorconfig for css and html 2022-05-17 21:13:17 +02:00
.gitattributes gitattributes: introduce and use "generated" attribute 2021-10-18 09:42:55 +02:00
.gitignore emacs: ignore .dir-locals-2.el (personal customization) versioning 2022-06-27 07:32:14 +00:00
.lgtm.yml Revert "lgtm: disable cpp/missing-return (again)" 2022-04-16 10:59:29 +00:00
.mailmap mailmap: two more names 2021-03-30 13:17:58 +02:00
.packit.yml Packit: build SRPMs in Copr 2022-03-09 09:52:41 +00:00
.vimrc scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure tools: shellcheck-ify tool scripts 2021-09-30 12:27:06 +02:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile tree-wide: add spdx header on all scripts and helpers 2021-01-28 09:55:35 +01:00
meson.build meson: Assign tests a suite based on their directory 2022-07-04 14:46:30 +02:00
meson_options.txt Merge pull request #23683 from keszybz/status-format 2022-06-10 14:11:53 +02:00
mkosi.build ci: check for failed services after boot 2021-12-10 10:25:43 +01:00
mkosi.postinst ci: check for failed services after boot 2021-12-10 10:25:43 +01:00
NEWS tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
README tree-wide: streamline wiki links 2022-05-21 14:28:03 +02:00
README.md README: rawhide -> Rawhide 2022-04-06 23:14:21 +09:00
TODO user: delegate cpu controller, assign weights to user slices 2022-07-05 14:40:01 +02:00

Systemd

System and Service Manager

Count of open issues over time Count of open pull requests over time Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
Language Grade: C/C++
CentOS CI - CentOS 8
CentOS CI - Arch
CentOS CI - Arch (sanitizers)
CentOS CI - Rawhide (SELinux)
Fossies codespell report
Coverage Status
Packaging status

Details

Most documentation is available on systemd's web site.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.