summaryrefslogtreecommitdiff
path: root/fsck/system-bcachefsck.slice
blob: ea368032636d365e5b27f143f3aa06e68436abb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2023-2024 Oracle.  All Rights Reserved.
# Author: Darrick J. Wong <djwong@kernel.org>

[Unit]
Description=bcachefsck background service slice
Before=slices.target

[Slice]

# If the CPU usage cgroup controller is available, don't use more than 60% of a
# single core for all background processes.
CPUQuota=60%
CPUAccounting=true

[Install]
# As of systemd 249, the systemd cgroupv2 configuration code will drop resource
# controllers from the root and system.slice cgroups at startup if it doesn't
# find any direct dependencies that require a given controller.  Newly
# activated units with resource control directives are created under the system
# slice but do not cause a reconfiguration of the slice's resource controllers.
# Hence we cannot put CPUQuota= into the bcachefsck service units directly.
#
# For the CPUQuota directive to have any effect, we must therefore create an
# explicit definition file for the slice that systemd creates to contain the
# bcachefsck instance units (e.g. bcachefsck@.service) and we must configure this
# slice as a dependency of the system slice to establish the direct dependency
# relation.
WantedBy=system.slice