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

Conversation

celestinechen
Copy link
Contributor

FIO with fsync option issues more DDIR_SYNC commands than expected

Issue and root cause

When fsync option is used, the number of flush (or DDIR_SYNC) commands
issued is more than the expected number of flush commands.
To elaborate:

  • In the fio config file, consider fsync=1
  1. FIO issues 1 write command
  2. After write completes, FIO sets last_was_sync variable to false
  3. FIO issues 1 flush command
  4. FIO keeps issuing flush commands since last_was_sync is still false
    and this causes more flush commands to be issued than expected
  5. last_was_sync is set to true after the flush command completes
  • The above steps repeats until the workload is completed.

Fix

Instead of setting last_was_sync to true after flush command is completed
and setting last_was_sync to false after write command is completed,
set last_was_sync to true after flush command is issued and set
last_was_sync to false after write command is issued.

Signed-off-by: Celestine Chen [email protected]

Issue and root cause:
When fsync option is used, the number of flush (or DDIR_SYNC) commands
issued is more than the expected number of flush commands.
To elaborate:
- In the fio config file, consider fsync=1
1. FIO issues 1 write command
2. After write completes, FIO sets last_was_sync variable to false
3. FIO issues 1 flush command
4. FIO keeps issuing flush commands since last_was_sync is still false
and this causes more flush commands to be issued than expected
5. last_was_sync is set to true after the flush command completes
- The above steps repeats until the workload is completed.
Fix:
Instead of setting last_was_sync to true after flush command is completed
and setting last_was_sync to false after write command is completed,
set last_was_sync to true after flush command is issued and set
last_was_sync to false after write command is issued.

Signed-off-by: Celestine Chen [email protected]
@axboe axboe merged commit c948ee3 into axboe:master Apr 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants