]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: Also set io.bfq.weight
authorKai Krakow <kai@kaishome.de>
Sat, 17 Aug 2019 00:33:43 +0000 (02:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Aug 2019 09:50:59 +0000 (11:50 +0200)
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.

Link: https://github.com/systemd/systemd/issues/7057
Signed-off-by: Kai Krakow <kai@kaishome.de>
NEWS
src/core/cgroup.c

diff --git a/NEWS b/NEWS
index df303d329e97c2f921eb7f986891d92a28809164..f6cf064281f99395b09f3ec371f9f8adc3ea8522 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -429,6 +429,9 @@ CHANGES WITH 243 in spe:
           option that permits selecting the timout how long to wait for a
           device with an encryption key before asking for the password.
 
+        * IOWeight= has learnt to properly set the IO weight when using the
+          BFQ scheduler officially found in kernels 5.0+.
+
         Contributions from: Aaron Barany, Adrian Bunk, Alan Jenkins, Andrej
         Valek, Anita Zhang, Arian van Putten, Balint Reczey, Bastien Nocera,
         Ben Boeckel, Benjamin Robin, camoz, Chen Qi, Chris Chiu, Chris Down,
index 6e0afa4bca3806ffd50133f0b39c12bdfd266650..60a77993616ee05cc32069cc8d8b5a888c44b2be 100644 (file)
@@ -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;