From: Andreas Herrmann <aherrmann@suse.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: fio@vger.kernel.org
Subject: [PATCH 1/2] thread_options: Add cgroup_use_bfq
Date: Fri, 28 Aug 2020 12:04:35 +0200 [thread overview]
Message-ID: <20200828100435.GH6041@suselix> (raw)
In-Reply-To: <20200828100230.GG6041@suselix>
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
HOWTO | 6 ++++++
cconv.c | 2 ++
fio.1 | 5 +++++
options.c | 11 +++++++++++
thread_options.h | 7 +++++--
5 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/HOWTO b/HOWTO
index e0403b08..4a16534f 100644
--- a/HOWTO
+++ b/HOWTO
@@ -2846,6 +2846,12 @@ Threads, processes and job synchronization
job completion, set ``cgroup_nodelete=1``. This can be useful if one wants
to inspect various cgroup files after job completion. Default: false.
+.. option:: cgroup_use_bfq=bool
+
+ Normally fio will use generic sysfs attributes to set cgroup_weight.
+ To use attributes specific to BFQ IO scheduler set ``cgroup_use_bfq=1``.
+ Default: false.
+
.. option:: flow_id=int
The ID of the flow. If not specified, it defaults to being a global
diff --git a/cconv.c b/cconv.c
index 4b0c3490..3f99e8d7 100644
--- a/cconv.c
+++ b/cconv.c
@@ -278,6 +278,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
o->continue_on_error = le32_to_cpu(top->continue_on_error);
o->cgroup_weight = le32_to_cpu(top->cgroup_weight);
o->cgroup_nodelete = le32_to_cpu(top->cgroup_nodelete);
+ o->cgroup_use_bfq = le32_to_cpu(top->cgroup_use_bfq);
o->uid = le32_to_cpu(top->uid);
o->gid = le32_to_cpu(top->gid);
o->flow_id = __le32_to_cpu(top->flow_id);
@@ -478,6 +479,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
top->continue_on_error = cpu_to_le32(o->continue_on_error);
top->cgroup_weight = cpu_to_le32(o->cgroup_weight);
top->cgroup_nodelete = cpu_to_le32(o->cgroup_nodelete);
+ top->cgroup_use_bfq = cpu_to_le32(o->cgroup_use_bfq);
top->uid = cpu_to_le32(o->uid);
top->gid = cpu_to_le32(o->gid);
top->flow_id = __cpu_to_le32(o->flow_id);
diff --git a/fio.1 b/fio.1
index 1c90e4a5..a0896235 100644
--- a/fio.1
+++ b/fio.1
@@ -2544,6 +2544,11 @@ completion. To override this behavior and to leave cgroups around after the
job completion, set `cgroup_nodelete=1'. This can be useful if one wants
to inspect various cgroup files after job completion. Default: false.
.TP
+.BI cgroup_use_bfq \fR=\fPbool
+Normally fio will use generic sysfs attributes to set cgroup_weight.
+To use attributes specific to BFQ IO scheduler set ``cgroup_use_bfq=1``.
+Default: false.
+.TP
.BI flow_id \fR=\fPint
The ID of the flow. If not specified, it defaults to being a global
flow. See \fBflow\fR.
diff --git a/options.c b/options.c
index 251ad2c1..c84e911a 100644
--- a/options.c
+++ b/options.c
@@ -4609,6 +4609,17 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_CGROUP,
},
+ {
+ .name = "cgroup_use_bfq",
+ .lname = "Cgroup use-bfq",
+ .type = FIO_OPT_BOOL,
+ .off1 = offsetof(struct thread_options, cgroup_use_bfq),
+ .help = "Use cgroup sysfs attributes specific to BFQ",
+ .def = "0",
+ .parent = "cgroup",
+ .category = FIO_OPT_C_GENERAL,
+ .group = FIO_OPT_G_CGROUP,
+ },
{
.name = "uid",
.lname = "User ID",
diff --git a/thread_options.h b/thread_options.h
index 14f1cbe9..0331e881 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -302,11 +302,12 @@ struct thread_options {
char *profile;
/*
- * blkio cgroup support
+ * (blk)io cgroup support
*/
char *cgroup;
unsigned int cgroup_weight;
unsigned int cgroup_nodelete;
+ unsigned int cgroup_use_bfq;
unsigned int uid;
unsigned int gid;
@@ -593,11 +594,13 @@ struct thread_options_pack {
uint8_t profile[FIO_TOP_STR_MAX];
/*
- * blkio cgroup support
+ * (blk)io cgroup support
*/
uint8_t cgroup[FIO_TOP_STR_MAX];
uint32_t cgroup_weight;
uint32_t cgroup_nodelete;
+ uint32_t cgroup_use_bfq;
+ uint32_t padding; /* remove when possible to maintain alignment */
uint32_t uid;
uint32_t gid;
--
2.28.0
next prev parent reply other threads:[~2020-08-28 10:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-28 10:02 [PATCH 0/2] cgroup: Enable weight tests with cgroup-v2 Andreas Herrmann
2020-08-28 10:04 ` Andreas Herrmann [this message]
2020-08-28 18:36 ` [PATCH 1/2] thread_options: Add cgroup_use_bfq Elliott, Robert (Servers)
2020-08-28 23:52 ` Jens Axboe
2020-08-29 2:14 ` Elliott, Robert (Servers)
2020-08-31 6:07 ` Andreas Herrmann
2020-08-31 6:03 ` Andreas Herrmann
2020-08-28 10:06 ` [PATCH 2/2] cgroup: Allow to use weights with cgroup-v2 Andreas Herrmann
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=20200828100435.GH6041@suselix \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.