* [PATCH 0/6] Some minor cleanups
@ 2024-03-02 8:36 Avri Altman
2024-03-02 8:36 ` [PATCH 1/6] fio: Some minor code cleanups Avri Altman
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
Mainly fixing typos, style issues, etc.
Avri Altman (6):
fio: Some minor code cleanups
t/jobs: Further clarify regression test 7
t/jobs: Further clarify regression test 8
t/jobs: Rename test job 15
t/jobs: Fix a typo in jobs 23 & 24
Doc: Make note of using bsrange with ':'
HOWTO.rst | 4 ++--
backend.c | 4 ++--
eta.c | 8 +++++---
io_u.c | 3 ++-
parse.h | 2 +-
stat.h | 1 -
t/jobs/t0007-37cf9e3c.fio | 5 ++++-
t/jobs/t0008-ae2fafc8.fio | 3 ++-
t/jobs/{t0015-e78980ff.fio => t0015-4e7e7898.fio} | 0
t/jobs/t0023.fio | 4 ++--
t/jobs/t0024.fio | 2 +-
t/run-fio-tests.py | 2 +-
12 files changed, 22 insertions(+), 16 deletions(-)
rename t/jobs/{t0015-e78980ff.fio => t0015-4e7e7898.fio} (100%)
--
2.42.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/6] fio: Some minor code cleanups
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
@ 2024-03-02 8:36 ` Avri Altman
2024-03-02 8:36 ` [PATCH 2/6] t/jobs: Further clarify regression test 7 Avri Altman
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
limit the scope of variables when possible, fix style isses etc.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
HOWTO.rst | 2 +-
backend.c | 4 ++--
eta.c | 8 +++++---
io_u.c | 3 ++-
parse.h | 2 +-
stat.h | 1 -
6 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/HOWTO.rst b/HOWTO.rst
index 169cdc2a..c404d724 100644
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -2786,7 +2786,7 @@ with the caveat that when used on the command line, they must come after the
.. option:: sg_write_mode=str : [sg]
- Specify the type of write commands to issue. This option can take three values:
+ Specify the type of write commands to issue. This option can take ten values:
**write**
This is the default where write opcodes are issued as usual.
diff --git a/backend.c b/backend.c
index 2f2221bf..fb7dc68a 100644
--- a/backend.c
+++ b/backend.c
@@ -2094,14 +2094,14 @@ static void reap_threads(unsigned int *nr_running, uint64_t *t_rate,
uint64_t *m_rate)
{
unsigned int cputhreads, realthreads, pending;
- int status, ret;
+ int ret;
/*
* reap exited threads (TD_EXITED -> TD_REAPED)
*/
realthreads = pending = cputhreads = 0;
for_each_td(td) {
- int flags = 0;
+ int flags = 0, status;
if (!strcmp(td->o.ioengine, "cpuio"))
cputhreads++;
diff --git a/eta.c b/eta.c
index cc342461..7d07708f 100644
--- a/eta.c
+++ b/eta.c
@@ -215,8 +215,9 @@ static unsigned long thread_eta(struct thread_data *td)
perc = td->o.rwmix[DDIR_WRITE];
bytes_total += (bytes_total * perc) / 100;
- } else
+ } else {
bytes_total <<= 1;
+ }
}
if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) {
@@ -228,8 +229,9 @@ static unsigned long thread_eta(struct thread_data *td)
perc = (double) bytes_done / (double) bytes_total;
if (perc > 1.0)
perc = 1.0;
- } else
+ } else {
perc = 0.0;
+ }
if (td->o.time_based) {
if (timeout) {
@@ -395,7 +397,7 @@ static bool skip_eta()
* Print status of the jobs we know about. This includes rate estimates,
* ETA, thread state, etc.
*/
-bool calc_thread_status(struct jobs_eta *je, int force)
+static bool calc_thread_status(struct jobs_eta *je, int force)
{
int unified_rw_rep;
bool any_td_in_ramp;
diff --git a/io_u.c b/io_u.c
index 2b8e17f8..09e5f15a 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1895,8 +1895,9 @@ struct io_u *get_io_u(struct thread_data *td)
io_u->buflen);
} else if ((td->flags & TD_F_SCRAMBLE_BUFFERS) &&
!(td->flags & TD_F_COMPRESS) &&
- !(td->flags & TD_F_DO_VERIFY))
+ !(td->flags & TD_F_DO_VERIFY)) {
do_scramble = 1;
+ }
} else if (io_u->ddir == DDIR_READ) {
/*
* Reset the buf_filled parameters so next time if the
diff --git a/parse.h b/parse.h
index d68484ea..806a76ee 100644
--- a/parse.h
+++ b/parse.h
@@ -32,7 +32,7 @@ enum fio_opt_type {
*/
struct value_pair {
const char *ival; /* string option */
- unsigned long long oval;/* output value */
+ unsigned long long oval; /* output value */
const char *help; /* help text for sub option */
int orval; /* OR value */
void *cb; /* sub-option callback */
diff --git a/stat.h b/stat.h
index bd986d4e..0d57cceb 100644
--- a/stat.h
+++ b/stat.h
@@ -345,7 +345,6 @@ extern void stat_exit(void);
extern struct json_object * show_thread_status(struct thread_stat *ts, struct group_run_stats *rs, struct flist_head *, struct buf_output *);
extern void show_group_stats(struct group_run_stats *rs, struct buf_output *);
-extern bool calc_thread_status(struct jobs_eta *je, int force);
extern void display_thread_status(struct jobs_eta *je);
extern void __show_run_stats(void);
extern int __show_running_run_stats(void);
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/6] t/jobs: Further clarify regression test 7
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
2024-03-02 8:36 ` [PATCH 1/6] fio: Some minor code cleanups Avri Altman
@ 2024-03-02 8:36 ` Avri Altman
2024-03-02 8:36 ` [PATCH 3/6] t/jobs: Further clarify regression test 8 Avri Altman
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
Add some more details explaining why the the successful result should be
87,040KB data.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
t/jobs/t0007-37cf9e3c.fio | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/jobs/t0007-37cf9e3c.fio b/t/jobs/t0007-37cf9e3c.fio
index d3c98751..a5971759 100644
--- a/t/jobs/t0007-37cf9e3c.fio
+++ b/t/jobs/t0007-37cf9e3c.fio
@@ -1,4 +1,7 @@
-# Expected result: fio reads 87040KB of data
+# Expected result: fio reads 87040KB of data:
+# first read is at offset 0, then 2nd read is at offset 1.5m, then the 3rd
+# read is at offset 3m, and after the last read at offset 127 - we have only
+# read 87,040K data.
# Buggy result: fio reads the full 128MB of data
[foo]
size=128mb
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/6] t/jobs: Further clarify regression test 8
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
2024-03-02 8:36 ` [PATCH 1/6] fio: Some minor code cleanups Avri Altman
2024-03-02 8:36 ` [PATCH 2/6] t/jobs: Further clarify regression test 7 Avri Altman
@ 2024-03-02 8:36 ` Avri Altman
2024-03-02 8:36 ` [PATCH 4/6] t/jobs: Rename test job 15 Avri Altman
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
Add some more details explaining the expected result
Signe -off-by: Avri Altman <avri.altman@wdc.com>
---
t/jobs/t0008-ae2fafc8.fio | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/jobs/t0008-ae2fafc8.fio b/t/jobs/t0008-ae2fafc8.fio
index 4b364850..f4e8a06e 100644
--- a/t/jobs/t0008-ae2fafc8.fio
+++ b/t/jobs/t0008-ae2fafc8.fio
@@ -1,4 +1,5 @@
-# Expected result: fio writes 16MB, reads 16+16MB
+# Expected result: fio writes 16MB, reads 16MB+16Kb of metadata:
+# 16mb writes of 4K blocks are 4k IOs, each creates a 4 bytes of crc data = 16K
# Buggy result: fio writes 16MB, reads ~21MB
[global]
bs=4k
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/6] t/jobs: Rename test job 15
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
` (2 preceding siblings ...)
2024-03-02 8:36 ` [PATCH 3/6] t/jobs: Further clarify regression test 8 Avri Altman
@ 2024-03-02 8:36 ` Avri Altman
2024-03-02 8:36 ` [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24 Avri Altman
2024-03-02 8:36 ` [PATCH 6/6] Doc: Make note of using bsrange with ':' Avri Altman
5 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
Make it designate the correct fixing commit.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
t/jobs/{t0015-e78980ff.fio => t0015-4e7e7898.fio} | 0
t/run-fio-tests.py | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename t/jobs/{t0015-e78980ff.fio => t0015-4e7e7898.fio} (100%)
diff --git a/t/jobs/t0015-e78980ff.fio b/t/jobs/t0015-4e7e7898.fio
similarity index 100%
rename from t/jobs/t0015-e78980ff.fio
rename to t/jobs/t0015-4e7e7898.fio
diff --git a/t/run-fio-tests.py b/t/run-fio-tests.py
index d4742e96..08134e50 100755
--- a/t/run-fio-tests.py
+++ b/t/run-fio-tests.py
@@ -722,7 +722,7 @@ TEST_LIST = [
{
'test_id': 15,
'test_class': FioJobFileTest_t0015,
- 'job': 't0015-e78980ff.fio',
+ 'job': 't0015-4e7e7898.fio',
'success': SUCCESS_DEFAULT,
'pre_job': None,
'pre_success': None,
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
` (3 preceding siblings ...)
2024-03-02 8:36 ` [PATCH 4/6] t/jobs: Rename test job 15 Avri Altman
@ 2024-03-02 8:36 ` Avri Altman
2024-03-02 12:42 ` Vincent Fu
2024-03-02 8:36 ` [PATCH 6/6] Doc: Make note of using bsrange with ':' Avri Altman
5 siblings, 1 reply; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
s/bsrange/bssplit
Fixes: commit c37183f8a161 (test: test job for randtrimwrite)
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
t/jobs/t0023.fio | 4 ++--
t/jobs/t0024.fio | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/jobs/t0023.fio b/t/jobs/t0023.fio
index 4f0bef89..b051fef2 100644
--- a/t/jobs/t0023.fio
+++ b/t/jobs/t0023.fio
@@ -33,7 +33,7 @@ bsrange=512-4k
# block sizes match
# Buggy result: something else
[bssplit]
-bsrange=512/25:1k:25:2k:25:4k/25
+bssplit=512/25:1k/:2k/:/4k
# Expected result: trim issued to random offset followed by write to same offset
# block sizes match
@@ -59,5 +59,5 @@ norandommap=1
# block sizes match
# Buggy result: something else
[bssplit_no_rm]
-bsrange=512/25:1k:25:2k:25:4k/25
+bssplit=512/25:1k/:2k/:4k/
norandommap=1
diff --git a/t/jobs/t0024.fio b/t/jobs/t0024.fio
index 393a2b70..2b3dc94c 100644
--- a/t/jobs/t0024.fio
+++ b/t/jobs/t0024.fio
@@ -33,4 +33,4 @@ bsrange=512-4k
# block sizes match
# Buggy result: something else
[bssplit]
-bsrange=512/25:1k:25:2k:25:4k/25
+bssplit=512/25:1k/:2k/:4k/
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/6] Doc: Make note of using bsrange with ':'
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
` (4 preceding siblings ...)
2024-03-02 8:36 ` [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24 Avri Altman
@ 2024-03-02 8:36 ` Avri Altman
5 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 8:36 UTC (permalink / raw)
To: Jens Axboe, Vincent Fu; +Cc: fio, Avri Altman
Which is also a supported form of delimiter.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
HOWTO.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/HOWTO.rst b/HOWTO.rst
index c404d724..2386d806 100644
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -1631,7 +1631,7 @@ Block size
Comma-separated ranges may be specified for reads, writes, and trims as
described in :option:`blocksize`.
- Example: ``bsrange=1k-4k,2k-8k``.
+ Example: ``bsrange=1k-4k,2k-8k`` also the ':' delimiter ``bsrange=1k:4k,2k:8k``.
.. option:: bssplit=str[,str][,str]
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24
2024-03-02 8:36 ` [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24 Avri Altman
@ 2024-03-02 12:42 ` Vincent Fu
2024-03-02 19:18 ` Avri Altman
0 siblings, 1 reply; 9+ messages in thread
From: Vincent Fu @ 2024-03-02 12:42 UTC (permalink / raw)
To: Avri Altman, Jens Axboe, Vincent Fu; +Cc: fio
On 3/2/24 03:36, Avri Altman wrote:
> s/bsrange/bssplit
>
> Fixes: commit c37183f8a161 (test: test job for randtrimwrite)
> Signed-off-by: Avri Altman <avri.altman@wdc.com>
> ---
> t/jobs/t0023.fio | 4 ++--
> t/jobs/t0024.fio | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/t/jobs/t0023.fio b/t/jobs/t0023.fio
> index 4f0bef89..b051fef2 100644
> --- a/t/jobs/t0023.fio
> +++ b/t/jobs/t0023.fio
> @@ -33,7 +33,7 @@ bsrange=512-4k
> # block sizes match
> # Buggy result: something else
> [bssplit]
> -bsrange=512/25:1k:25:2k:25:4k/25
> +bssplit=512/25:1k/:2k/:/4k
Thanks for catching this issue.
The end of the line above should be 4k/ instead of /4k
https://github.com/fiotestbot/fio/actions/runs/8121755928
>
> # Expected result: trim issued to random offset followed by write to same offset
> # block sizes match
> @@ -59,5 +59,5 @@ norandommap=1
> # block sizes match
> # Buggy result: something else
> [bssplit_no_rm]
> -bsrange=512/25:1k:25:2k:25:4k/25
> +bssplit=512/25:1k/:2k/:4k/
> norandommap=1
> diff --git a/t/jobs/t0024.fio b/t/jobs/t0024.fio
> index 393a2b70..2b3dc94c 100644
> --- a/t/jobs/t0024.fio
> +++ b/t/jobs/t0024.fio
> @@ -33,4 +33,4 @@ bsrange=512-4k
> # block sizes match
> # Buggy result: something else
> [bssplit]
> -bsrange=512/25:1k:25:2k:25:4k/25
> +bssplit=512/25:1k/:2k/:4k/
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24
2024-03-02 12:42 ` Vincent Fu
@ 2024-03-02 19:18 ` Avri Altman
0 siblings, 0 replies; 9+ messages in thread
From: Avri Altman @ 2024-03-02 19:18 UTC (permalink / raw)
To: Vincent Fu, Jens Axboe, Vincent Fu; +Cc: fio
> On 3/2/24 03:36, Avri Altman wrote:
> > s/bsrange/bssplit
> >
> > Fixes: commit c37183f8a161 (test: test job for randtrimwrite)
> > Signed-off-by: Avri Altman <avri.altman@wdc.com>
> > ---
> > t/jobs/t0023.fio | 4 ++--
> > t/jobs/t0024.fio | 2 +-
> > 2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/t/jobs/t0023.fio b/t/jobs/t0023.fio index
> > 4f0bef89..b051fef2 100644
> > --- a/t/jobs/t0023.fio
> > +++ b/t/jobs/t0023.fio
> > @@ -33,7 +33,7 @@ bsrange=512-4k
> > # block sizes match
> > # Buggy result: something else
> > [bssplit]
> > -bsrange=512/25:1k:25:2k:25:4k/25
> > +bssplit=512/25:1k/:2k/:/4k
>
> Thanks for catching this issue.
>
> The end of the line above should be 4k/ instead of /4k
>
> https://github.com/fiotestbot/fio/actions/runs/8121755928
Thanks. Will fix in v2.
Thanks,
Avri
>
> >
> > # Expected result: trim issued to random offset followed by write to same
> offset
> > # block sizes match
> > @@ -59,5 +59,5 @@ norandommap=1
> > # block sizes match
> > # Buggy result: something else
> > [bssplit_no_rm]
> > -bsrange=512/25:1k:25:2k:25:4k/25
> > +bssplit=512/25:1k/:2k/:4k/
> > norandommap=1
> > diff --git a/t/jobs/t0024.fio b/t/jobs/t0024.fio index
> > 393a2b70..2b3dc94c 100644
> > --- a/t/jobs/t0024.fio
> > +++ b/t/jobs/t0024.fio
> > @@ -33,4 +33,4 @@ bsrange=512-4k
> > # block sizes match
> > # Buggy result: something else
> > [bssplit]
> > -bsrange=512/25:1k:25:2k:25:4k/25
> > +bssplit=512/25:1k/:2k/:4k/
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-03-02 19:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-02 8:36 [PATCH 0/6] Some minor cleanups Avri Altman
2024-03-02 8:36 ` [PATCH 1/6] fio: Some minor code cleanups Avri Altman
2024-03-02 8:36 ` [PATCH 2/6] t/jobs: Further clarify regression test 7 Avri Altman
2024-03-02 8:36 ` [PATCH 3/6] t/jobs: Further clarify regression test 8 Avri Altman
2024-03-02 8:36 ` [PATCH 4/6] t/jobs: Rename test job 15 Avri Altman
2024-03-02 8:36 ` [PATCH 5/6] t/jobs: Fix a typo in jobs 23 & 24 Avri Altman
2024-03-02 12:42 ` Vincent Fu
2024-03-02 19:18 ` Avri Altman
2024-03-02 8:36 ` [PATCH 6/6] Doc: Make note of using bsrange with ':' Avri Altman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).