How to loop a timebased job
Hey,
I'm on the IRC channel trying to help someone that needs to do the following :
doing IOs for x seconds
sleeping for y seconds
and looping this z times
While trying to setup this, I faced that loops and timebased seems exclusive options. Am I wrong on this point ?
If not, would it be possible not to let them exclusive or add a new option to handle this case?
Cheers,
Erwan
Quoted 9 lines · Erwan Velu
Hey,
I'm on the IRC channel trying to help someone that needs to do the following :
doing IOs for x seconds
sleeping for y seconds
and looping this z times
Quoted 6 lines
While trying to setup this, I faced that loops and timebased seems exclusive options.
Am I wrong on this point ?If not, would it be possible not to let them exclusive or add a new option to handle this case?
It should work, if it doesn't, I agree it's a bug. It's not certain than anyone has considered this specific use case before.
Feel free to fix! Or I can take a look at it tomorrow.
Signature · 1 line
Jens Axboe
Quoted 1 line · Jens Axboe
It should work, if it doesn't, I agree it's a bug. It's not certain than anyone has considered this specific use case before. Feel free to fix! Or I can take a look at it tomorrow.
I think I found the issue but my main question is about priority.
If both time & loops are set, what shall be considered as the key element to stop the benchmark.
Today, time have the priority over loops as keep_running() returns if time_based while time is handled in do_io().
If I do remove this test in keep_running, the first of the two getting the limit will stop the job. On one hand, we have timebased option to insure time over end of device.
Shall we put a loopbased on the other hand ?
My 2 cents,
Erwan
Quoted 9 lines · Erwan Velu
Quoted 3 lines · Jens Axboe
It should work, if it doesn't, I agree it's a bug. It's not certain than anyone has considered this specific use case before. Feel free to fix! Or I can take a look at it tomorrow.
I think I found the issue but my main question is about priority.
If both time & loops are set, what shall be considered as the key element to stop the benchmark.
Quoted 7 lines
Today, time have the priority over loops as
keep_running()returns iftime_basedwhile time is handled indo_io().If I do remove this test in
keep_running, the first of the two getting the limit will stop the job.
On one hand, we have timebased option to insure time over end of device. Shall we put a loopbased on the other hand ?
Good point, yes, that is a problem. Adding a loopbased option would seem to be the best way to solve the dependency issue.
Signature · 1 line
Jens Axboe
Quoted 1 line · Jens Axboe
Good point, yes, that is a problem. Adding a loopbased option would seem to be the best way to solve the dependency issue.
Ok, I'm working on this option.
Here come the kind of usage I'm thinking about :
[general]
....loop_based
loops=5
[job_1]
....
runtime=10
[job_2]
....
runtime=20
That lever the question on where we shall "loop" the jobs ?
What's the preferred option regarding your experience on fio ?
The main problem I'm facing is to reinit properly jobs between loops (like td->terminate or doing the start_delay,...)
Shall it be better to manage it inside thread_main() or get it outside ?
Thanks for your insights,
Erwan
Quoted 21 lines · Erwan Velu
Quoted 2 lines · Jens Axboe
Good point, yes, that is a problem. Adding a loopbased option would seem to be the best way to solve the dependency issue.
Ok, I'm working on this option.
Here come the kind of usage I'm thinking about :
[general]
....loop_based
loops=5[
job_1]
....
runtime=10[
job_2]
....
runtime=20
Quoted 6 lines
That lever the question on where we shall "loop" the jobs ? What's the preferred option regarding your experience on fio ? The main problem I'm facing is to reinit properly jobs between loops (like
td->terminateor doing thestart_delay,...)Shall it be better to manage it inside
thread_main()or get it outside ?
I think you want to do it inside thread_main(), similarly to how it's done for just plain loops or timed based running. The clearing of state between runs should take care of it.
Signature · 1 line
Jens Axboe