Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,17 @@ void on_fsync_completed(struct thread_data *td, struct io_u *io_u)
*
* Returns number of bytes written and trimmed.
*/
static bool trimwrite_mid_pair(struct thread_data *td)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above this function applies to do_io()

{
struct fio_file *f;

if (!td_trimwrite(td) || td->o.nr_files != 1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

td_trimwrite() just checks if the write and trim bits of the job's ddir are set. Both of the bits are set for rw=[rand]trimwrite but can also be set for iolog replay jobs. Would this check cause an iolog replay job that includes trims and writes to exceed its specified runtime?

return false;

f = td->files[0];
return f->last_start[DDIR_WRITE] != f->last_start[DDIR_TRIM];
}

static void do_io(struct thread_data *td, uint64_t *bytes_done)
{
unsigned int i;
Expand Down Expand Up @@ -1211,7 +1222,8 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)

if (runtime_exceeded(td, &td->ts_cache)) {
__update_ts_cache(td);
if (runtime_exceeded(td, &td->ts_cache)) {
if (runtime_exceeded(td, &td->ts_cache) &&
!trimwrite_mid_pair(td)) {
fio_mark_td_terminate(td);
break;
}
Expand All @@ -1228,6 +1240,7 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
*/
if (bytes_issued >= total_bytes &&
!td->o.read_iolog_file &&
!trimwrite_mid_pair(td) &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bytes_issued is adjusted near the top of do_io() for trimwrite workloads. Why is this check necessary here?

(!td->o.time_based ||
(td->o.time_based && td->o.verify != VERIFY_NONE)))
break;
Expand Down
Loading