Skip to content
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 with fsync option issues more DDIR_SYNC commands than expected #1754

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,6 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
if (ddir_sync(ddir)) {
if (io_u->error)
goto error;
td->last_was_sync = true;
if (f) {
f->first_write = -1ULL;
f->last_write = -1ULL;
Expand All @@ -2123,7 +2122,6 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
return;
}

td->last_was_sync = false;
td->last_ddir = ddir;

if (!io_u->error && ddir_rw(ddir)) {
Expand Down
4 changes: 4 additions & 0 deletions ioengines.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
io_u_mark_depth(td, 1);
td->ts.total_io_u[io_u->ddir]++;
}

td->last_was_sync = ddir_sync(io_u->ddir);
} else if (ret == FIO_Q_QUEUED) {
td->io_u_queued++;

Expand All @@ -445,6 +447,8 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)

if (td->io_u_queued >= td->o.iodepth_batch)
td_io_commit(td);

td->last_was_sync = ddir_sync(io_u->ddir);
}

if (!td_ioengine_flagged(td, FIO_SYNCIO) &&
Expand Down