-
Notifications
You must be signed in to change notification settings - Fork 1.4k
trimwrite: do not terminate between a trim and its paired write #2131
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
| { | ||
| struct fio_file *f; | ||
|
|
||
| if (!td_trimwrite(td) || td->o.nr_files != 1) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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; | ||
|
|
@@ -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; | ||
| } | ||
|
|
@@ -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) && | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| (!td->o.time_based || | ||
| (td->o.time_based && td->o.verify != VERIFY_NONE))) | ||
| break; | ||
|
|
||
There was a problem hiding this comment.
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()