New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIO can only run 2 seconds with RandSeed=47827 #1486
Comments
Hi @ningqingqing I ran both the commands and was able to replicate what you observed. With randseed=47827 I saw that fio wrote exactly 1694 MiB data, which is the same in the attached log. With randseed=47807 it was able to write entire 52.2 GiB I enabled --debug=io for randseed=47827 and observed that fio fails, as the next generated random offset lies outside start offset and io_size. io 8915 get_next_offset: offset 56019255296 >= io_size 56019152896 This is also observed with randseed=47867 and randseed=47847 but at different point of time. I also ran fio by removing percentage_random=50 (i.e. fully 100% random workload) and the issue was not seen with these randseed values. So it seems there is something weird happening with fio's random generation only when me mix random and sequential workloads. I will go through this section of code and see if I can find the exact problem. |
Hi, @ankit-sam , thanks for your time to replicate this. |
Hi, @ningqingqing I don't have much idea about transaction file command. Here is the possible fix for this issue, the change is based on fio-3.33 index 8035f4b7..e49b1b29 100644
--- a/io_u.c
+++ b/io_u.c
@@ -432,8 +432,11 @@ static int get_next_block(struct thread_data *td, struct io_u *io_u,
*is_random = false;
io_u_set(td, io_u, IO_U_F_BUSY_OK);
ret = get_next_seq_offset(td, f, ddir, &offset);
- if (ret)
+ if (ret || offset >= f->io_size) {
ret = get_next_rand_block(td, f, ddir, &b);
+ offset = -1ULL;
+ *is_random = true;
+ }
}
} else {
*is_random = false; The actual issue was with sequential offset generation in this case when we have mix of sequential and random workload. The
For sequential and random mix workload case, I have observed that Can you please verify the changes and see that it doesn't break any existing functionality. if its fine I can submit a patch. Tagging @vincentkfu for this inputs. |
Hi, @ankit-sam , thank you so much, I will try later. |
Hi, @ningqingqing you can try with fio option I submitted a patch but it affects when we are operating on multiple files, and later found that that there are a lot of places where size does not work as specified and modifying the existing code can result in regression. You can see the discussion in lore: I think the work around is to update fio documentation for |
In few cases with fio option size the number of bytes of data transferred is actually less than what we specified. This can happen if there are gaps or holes while doing I/O's or if we are running a mix of sequential and random workload. Update the documentation for that. Fixes: axboe#1486 Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Please acknowledge the following before creating a ticket
Description of the bug:
<FIO can only run 1-2 seconds if set randseed=47827>
Environment: <Linux, CentOS>
fio version: <FIO3.25>
Reproduction steps
<We have run two fio test, the only difference between them is we set different randseed value.
In the first fio test, we set randseed=47827, fio can only run 2 seconds
job command as below:
sudo fio --thread --ioengine=libaio --numjobs=1 --direct=1 --filename=/dev/nvme0n1 --name=bs131072_rwrandrw_qd32 --rwmixread=0 --rw=randrw --percentage_random=50 --randrepeat=0 --size=56019152896 --bs=131072 --offset=0 --randseed=47827 --iodepth=32 --max_latency=16000ms --cpus_allowed=0-3
fio output:
47827.txt
In the second fio test, we set randseed=47807, fio run normally
job command as below:
sudo fio --thread --ioengine=libaio --numjobs=1 --direct=1 --filename=/dev/nvme0n1 --name=bs131072_rwrandrw_qd32 --rwmixread=0 --rw=randrw --percentage_random=50 --randrepeat=0 --size=56019152896 --bs=131072 --offset=0 --randseed=47807 --iodepth=32 --max_latency=16000ms --cpus_allowed=0-3
fio output:
47807.txt
Could you help share why randseed parameter affect test time and what this parameter did in fio test?>
The text was updated successfully, but these errors were encountered: