Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Andreas Herrmann <aherrmann@suse.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: fio <fio@vger.kernel.org>, Andreas Herrmann <aherrmann@suse.com>
Subject: [PATCH v3 resend 4/4] cgroup: Support BFQ's weight attributes
Date: Fri, 30 Oct 2020 12:11:52 +0100	[thread overview]
Message-ID: <20201030111147.19175-5-aherrmann@suse.com> (raw)
In-Reply-To: <20201030111147.19175-1-aherrmann@suse.com>

Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
 cgroup.c | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/cgroup.c b/cgroup.c
index c6369f54..903c569e 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -236,15 +236,29 @@ int cgroup_setup(struct thread_data *td, struct flist_head *clist, struct cgroup
 			if (write_str_to_file(td, (*mnt)->path, "cgroup.subtree_control",
 						"+io", "cgroup open cgroup.subtree_control"))
 				goto err;
-			if (write_int_to_file(td, root, "io.weight",
-						td->o.cgroup_weight,
-						"cgroup open io.weight"))
-				goto err;
+			if (td->o.cgroup_use_bfq) {
+				if (write_int_to_file(td, root, "io.bfq.weight",
+							td->o.cgroup_weight,
+							"cgroup open io.bfq.weight"))
+					goto err;
+			} else {
+				if (write_int_to_file(td, root, "io.weight",
+							td->o.cgroup_weight,
+							"cgroup open io.weight"))
+					goto err;
+			}
 		} else {
-			if (write_int_to_file(td, root, "blkio.weight",
-						td->o.cgroup_weight,
-						"cgroup open blkio.weight"))
-				goto err;
+			if (td->o.cgroup_use_bfq) {
+				if (write_int_to_file(td, root, "blkio.bfq.weight",
+							td->o.cgroup_weight,
+							"cgroup open blkio.bfq.weight"))
+					goto err;
+			} else {
+				if (write_int_to_file(td, root, "blkio.weight",
+							td->o.cgroup_weight,
+							"cgroup open blkio.weight"))
+					goto err;
+			}
 		}
 	}
 
-- 
2.29.0



  parent reply	other threads:[~2020-10-30 11:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 11:11 [PATCH v3 resend 0/4] cgroup: Support cgroup-v2 weight and BFQ weight Andreas Herrmann
2020-10-30 11:11 ` [PATCH v3 resend 1/4] cgroup: Fix handling when cgroup blkio and cgroup-v2 are mounted Andreas Herrmann
2020-10-30 11:11 ` [PATCH v3 resend 2/4] cgroup: Allow to use weights with cgroup-v2 Andreas Herrmann
2020-10-30 11:11 ` [PATCH v3 resend 3/4] thread_options: Introduce cgroup_use_bfq Andreas Herrmann
2020-10-30 11:11 ` Andreas Herrmann [this message]
2020-11-22 14:52 ` [PATCH v3 resend 0/4] cgroup: Support cgroup-v2 weight and BFQ weight Sitsofe Wheeler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201030111147.19175-5-aherrmann@suse.com \
    --to=aherrmann@suse.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox