summaryrefslogtreecommitdiffstats
path: root/src/core/cgroup.c
diff options
context:
space:
mode:
authorKai Krakow <kai@kaishome.de>2019-08-17 02:33:43 +0200
committerLennart Poettering <lennart@poettering.net>2019-08-20 11:50:59 +0200
commit2dbc45aea747f25cc1c3848fded2ec0062f96bcf (patch)
tree9f78764feb07e943d795bd10b3ce42f68ce96c4d /src/core/cgroup.c
parentMerge pull request #13356 from keszybz/static-nodes-perms (diff)
downloadsystemd-2dbc45aea747f25cc1c3848fded2ec0062f96bcf.tar.xz
systemd-2dbc45aea747f25cc1c3848fded2ec0062f96bcf.zip
cgroup: Also set io.bfq.weight
Current kernels with BFQ scheduler do not yet set their IO weight through "io.weight" but through "io.bfq.weight" (using a slightly different interface supporting only default weights, not per-device weights). This commit enables "IOWeight=" to just to that. This patch may be dropped at some time later. Github-Link: https://github.com/systemd/systemd/issues/7057 Signed-off-by: Kai Krakow <kai@kaishome.de>
Diffstat (limited to '')
-rw-r--r--src/core/cgroup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 6e0afa4bca..60a7799361 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -1063,6 +1063,11 @@ static void cgroup_context_apply(
xsprintf(buf, "default %" PRIu64 "\n", weight);
(void) set_attribute_and_warn(u, "io", "io.weight", buf);
+ /* FIXME: drop this when distro kernels properly support BFQ through "io.weight"
+ * See also: https://github.com/systemd/systemd/pull/13335 */
+ xsprintf(buf, "%" PRIu64 "\n", weight);
+ (void) set_attribute_and_warn(u, "io", "io.bfq.weight", buf);
+
if (has_io) {
CGroupIODeviceLatency *latency;
CGroupIODeviceLimit *limit;