Blame SOURCES/0001-thread_options-Use-unsigned-int-type-for-exit_what-a.patch

86436f
From fd56c235caa42870e6dc33d661514375ea95ffc5 Mon Sep 17 00:00:00 2001
86436f
From: =?UTF-8?q?Andr=C3=A9=20Wild?= <wild.andre.ae@gmail.com>
86436f
Date: Fri, 14 Aug 2020 15:52:09 +0200
86436f
Subject: [PATCH] thread_options: Use unsigned int type for exit_what and
86436f
 stonewall
86436f
MIME-Version: 1.0
86436f
Content-Type: text/plain; charset=UTF-8
86436f
Content-Transfer-Encoding: 8bit
86436f
86436f
Fixes: 64402a8 ("Expand choices for exitall")
86436f
Fixes: https://github.com/axboe/fio/issues/1065
86436f
Signed-off-by: André Wild <wild.andre.ae@gmail.com>
86436f
---
86436f
 cconv.c               |  8 ++++----
86436f
 examples/exitwhat.fio |  8 ++++----
86436f
 fio.1                 | 29 +++++++++++++++++++++--------
86436f
 server.h              |  2 +-
86436f
 thread_options.h      |  9 ++++-----
86436f
 5 files changed, 34 insertions(+), 22 deletions(-)
86436f
86436f
diff --git a/cconv.c b/cconv.c
86436f
index 2469389b..4b0c3490 100644
86436f
--- a/cconv.c
86436f
+++ b/cconv.c
86436f
@@ -237,8 +237,8 @@ void convert_thread_options_to_cpu(struct thread_options *o,
86436f
 	o->loops = le32_to_cpu(top->loops);
86436f
 	o->mem_type = le32_to_cpu(top->mem_type);
86436f
 	o->mem_align = le32_to_cpu(top->mem_align);
86436f
-	o->exit_what = le16_to_cpu(top->exit_what);
86436f
-	o->stonewall = le16_to_cpu(top->stonewall);
86436f
+	o->exit_what = le32_to_cpu(top->exit_what);
86436f
+	o->stonewall = le32_to_cpu(top->stonewall);
86436f
 	o->new_group = le32_to_cpu(top->new_group);
86436f
 	o->numjobs = le32_to_cpu(top->numjobs);
86436f
 	o->cpus_allowed_policy = le32_to_cpu(top->cpus_allowed_policy);
86436f
@@ -437,8 +437,8 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
86436f
 	top->loops = cpu_to_le32(o->loops);
86436f
 	top->mem_type = cpu_to_le32(o->mem_type);
86436f
 	top->mem_align = cpu_to_le32(o->mem_align);
86436f
-	top->exit_what = cpu_to_le16(o->exit_what);
86436f
-	top->stonewall = cpu_to_le16(o->stonewall);
86436f
+	top->exit_what = cpu_to_le32(o->exit_what);
86436f
+	top->stonewall = cpu_to_le32(o->stonewall);
86436f
 	top->new_group = cpu_to_le32(o->new_group);
86436f
 	top->numjobs = cpu_to_le32(o->numjobs);
86436f
 	top->cpus_allowed_policy = cpu_to_le32(o->cpus_allowed_policy);
86436f
diff --git a/examples/exitwhat.fio b/examples/exitwhat.fio
86436f
index a1099f0f..c91d7375 100644
86436f
--- a/examples/exitwhat.fio
86436f
+++ b/examples/exitwhat.fio
86436f
@@ -1,7 +1,7 @@
86436f
 # We want to run fast1 as long as slow1 is running, but also have a cumulative
86436f
 # report of fast1 (group_reporting=1/new_group=1).  exitall=1 would not cause
86436f
 # fast1 to stop after slow1 is done. Setting exit_what=stonewall will cause
86436f
-# alls jobs up until the next stonewall=1 setting to be stopped, when job slow1
86436f
+# alls jobs up until the next stonewall setting to be stopped, when job slow1
86436f
 # finishes.
86436f
 # In this example skipping forward to slow2/fast2. slow2 has exit_what=all set,
86436f
 # which means all jobs will be cancelled when slow2 finishes. In particular,
86436f
@@ -15,7 +15,7 @@ group_reporting=1
86436f
 exitall=1
86436f
 
86436f
 [slow1]
86436f
-rw=r
86436f
+rw=read
86436f
 numjobs=1
86436f
 ioengine=sync
86436f
 new_group=1
86436f
@@ -32,8 +32,8 @@ iodepth=32
86436f
 rate=300,300,300
86436f
 
86436f
 [slow2]
86436f
-stonewall=1
86436f
-rw=w
86436f
+stonewall
86436f
+rw=write
86436f
 numjobs=1
86436f
 ioengine=sync
86436f
 new_group=1
86436f
diff --git a/fio.1 b/fio.1
86436f
index cdd105d7..1c90e4a5 100644
86436f
--- a/fio.1
86436f
+++ b/fio.1
86436f
@@ -2569,7 +2569,8 @@ been exceeded before retrying operations.
86436f
 Wait for preceding jobs in the job file to exit, before starting this
86436f
 one. Can be used to insert serialization points in the job file. A stone
86436f
 wall also implies starting a new reporting group, see
86436f
-\fBgroup_reporting\fR.
86436f
+\fBgroup_reporting\fR. Optionally you can use `stonewall=0` to disable or
86436f
+`stonewall=1` to enable it.
86436f
 .TP
86436f
 .BI exitall
86436f
 By default, fio will continue running all other jobs when one job finishes.
86436f
@@ -2577,15 +2578,27 @@ Sometimes this is not the desired action. Setting \fBexitall\fR will instead
86436f
 make fio terminate all jobs in the same group, as soon as one job of that
86436f
 group finishes.
86436f
 .TP
86436f
-.BI exit_what
86436f
+.BI exit_what \fR=\fPstr
86436f
 By default, fio will continue running all other jobs when one job finishes.
86436f
-Sometimes this is not the desired action. Setting \fBexit_all\fR will instead
86436f
+Sometimes this is not the desired action. Setting \fBexitall\fR will instead
86436f
 make fio terminate all jobs in the same group. The option \fBexit_what\fR
86436f
-allows to control which jobs get terminated when \fBexitall\fR is enabled. The
86436f
-default is \fBgroup\fR and does not change the behaviour of \fBexitall\fR. The
86436f
-setting \fBall\fR terminates all jobs. The setting \fBstonewall\fR terminates
86436f
-all currently running jobs across all groups and continues execution with the
86436f
-next stonewalled group.
86436f
+allows you to control which jobs get terminated when \fBexitall\fR is enabled.
86436f
+The default value is \fBgroup\fR.
86436f
+The allowed values are:
86436f
+.RS
86436f
+.RS
86436f
+.TP
86436f
+.B all
86436f
+terminates all jobs.
86436f
+.TP
86436f
+.B group
86436f
+is the default and does not change the behaviour of \fBexitall\fR.
86436f
+.TP
86436f
+.B stonewall
86436f
+terminates all currently running jobs across all groups and continues
86436f
+execution with the next stonewalled group.
86436f
+.RE
86436f
+.RE
86436f
 .TP
86436f
 .BI exec_prerun \fR=\fPstr
86436f
 Before running this job, issue the command specified through
86436f
diff --git a/server.h b/server.h
86436f
index de01a5c8..efa70e7c 100644
86436f
--- a/server.h
86436f
+++ b/server.h
86436f
@@ -48,7 +48,7 @@ struct fio_net_cmd_reply {
86436f
 };
86436f
 
86436f
 enum {
86436f
-	FIO_SERVER_VER			= 83,
86436f
+	FIO_SERVER_VER			= 84,
86436f
 
86436f
 	FIO_SERVER_MAX_FRAGMENT_PDU	= 1024,
86436f
 	FIO_SERVER_MAX_CMD_MB		= 2048,
86436f
diff --git a/thread_options.h b/thread_options.h
86436f
index 3fe48ecc..14f1cbe9 100644
86436f
--- a/thread_options.h
86436f
+++ b/thread_options.h
86436f
@@ -202,8 +202,8 @@ struct thread_options {
86436f
 
86436f
 	unsigned long long max_latency;
86436f
 
86436f
-	unsigned short exit_what;
86436f
-	unsigned short stonewall;
86436f
+	unsigned int exit_what;
86436f
+	unsigned int stonewall;
86436f
 	unsigned int new_group;
86436f
 	unsigned int numjobs;
86436f
 	os_cpu_mask_t cpumask;
86436f
@@ -494,8 +494,8 @@ struct thread_options_pack {
86436f
 	uint32_t mem_type;
86436f
 	uint32_t mem_align;
86436f
 
86436f
-	uint16_t exit_what;
86436f
-	uint16_t stonewall;
86436f
+	uint32_t exit_what;
86436f
+	uint32_t stonewall;
86436f
 	uint32_t new_group;
86436f
 	uint32_t numjobs;
86436f
 	/*
86436f
@@ -546,7 +546,6 @@ struct thread_options_pack {
86436f
 	uint32_t lat_percentiles;
86436f
 	uint32_t slat_percentiles;
86436f
 	uint32_t percentile_precision;
86436f
-	uint32_t pad3;
86436f
 	fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
86436f
 
86436f
 	uint8_t read_iolog_file[FIO_TOP_STR_MAX];
86436f
-- 
86436f
2.17.0
86436f