]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: Also set blkio.bfq.weight
authorPavel Hrdina <phrdina@redhat.com>
Wed, 25 Nov 2020 08:05:36 +0000 (09:05 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 8 Dec 2020 18:15:26 +0000 (18:15 +0000)
Commit [1] added a workaround when unified cgroups are used but missed
legacy cgroups where there is the same issue.

[1] <https://github.com/systemd/systemd/commit/2dbc45aea747f25cc1c3848fded2ec0062f96bcf>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/core/cgroup.c

index b9d84dcca9356644c661b8f4f70d16fa3eec9588..fe7c80fdbc43052b04c990e4594f7ed16f4f6fe6 100644 (file)
@@ -1244,6 +1244,11 @@ static void cgroup_context_apply(
                         xsprintf(buf, "%" PRIu64 "\n", weight);
                         (void) set_attribute_and_warn(u, "blkio", "blkio.weight", buf);
 
+                        /* FIXME: drop this when distro kernels properly support BFQ through "blkio.weight"
+                         * See also: https://github.com/systemd/systemd/pull/13335 */
+                        xsprintf(buf, "%" PRIu64 "\n", weight);
+                        (void) set_attribute_and_warn(u, "blkio", "blkio.bfq.weight", buf);
+
                         if (has_io) {
                                 CGroupIODeviceWeight *w;