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 3/4] thread_options: Introduce cgroup_use_bfq
Date: Fri, 30 Oct 2020 12:11:50 +0100 [thread overview]
Message-ID: <20201030111147.19175-4-aherrmann@suse.com> (raw)
In-Reply-To: <20201030111147.19175-1-aherrmann@suse.com>
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
HOWTO | 6 ++++++
cconv.c | 2 ++
fio.1 | 5 +++++
options.c | 11 +++++++++++
server.h | 2 +-
thread_options.h | 7 +++++--
6 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/HOWTO b/HOWTO
index 386fd12a..2e94d793 100644
--- a/HOWTO
+++ b/HOWTO
@@ -2857,6 +2857,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 488dd799..ef5b6a97 100644
--- a/cconv.c
+++ b/cconv.c
@@ -279,6 +279,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);
@@ -479,6 +480,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 48119325..39b40772 100644
--- a/fio.1
+++ b/fio.1
@@ -2562,6 +2562,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 1e91b3e9..8136f262 100644
--- a/options.c
+++ b/options.c
@@ -4643,6 +4643,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/server.h b/server.h
index 6d444749..9256d44c 100644
--- a/server.h
+++ b/server.h
@@ -48,7 +48,7 @@ struct fio_net_cmd_reply {
};
enum {
- FIO_SERVER_VER = 86,
+ FIO_SERVER_VER = 87,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
FIO_SERVER_MAX_CMD_MB = 2048,
diff --git a/thread_options.h b/thread_options.h
index 97c400fe..f4d296c6 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -303,11 +303,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;
@@ -599,11 +600,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 pad3;
uint32_t uid;
uint32_t gid;
--
2.29.0
next prev 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 ` Andreas Herrmann [this message]
2020-10-30 11:11 ` [PATCH v3 resend 4/4] cgroup: Support BFQ's weight attributes Andreas Herrmann
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-4-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