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

filesize parses GiB/MiB values incorrectly #1740

Open
1 task done
Rogach opened this issue Mar 23, 2024 · 3 comments
Open
1 task done

filesize parses GiB/MiB values incorrectly #1740

Rogach opened this issue Mar 23, 2024 · 3 comments

Comments

@Rogach
Copy link

Rogach commented Mar 23, 2024

Please acknowledge the following before creating a ticket

Description of the bug:
Passing in --filesize value with GiB suffix seems to result in incorrect file size being used:

$ fio --name=seq --filename=fio.bin --filesize=4GiB --rw=write
seq: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.36
Starting 1 process
seq: Laying out IO file (1 file / 3814MiB)

If using Gi suffix then file size is correct:

$ fio --name=seq --filename=fio.bin --filesize=4Gi --rw=write
seq: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.36
Starting 1 process
seq: Laying out IO file (1 file / 4096MiB)

Environment: Arch Linux

fio version: fio-3.36

@vincentkfu
Copy link
Collaborator

We are stuck between a rock and a hard place here. We could make the default conform to how the rest of the world interprets these units. However, this change would break scripts that have accommodated this fio quirk.

If you want fio to follow your expected interpretation use kb_base=1000 option. Make sure this option is set before any options with suffixes. See:

https://fio.readthedocs.io/en/latest/fio_doc.html#units

@Rogach
Copy link
Author

Rogach commented Apr 20, 2024

I understand the value of backward compatibility, of course :) And the whole KB/KiB situation is just a big mess.

I've read the "Units" section prior to submitting the report. It was my understanding that the main issue was with KB units, since people commonly use them to mean both 1000 and 1024. However, I thought that KiB was unambiguous and always meant 1024. Are there scripts that were explicitly written with KiB=1000 in mind?

@sitsofe
Copy link
Collaborator

sitsofe commented Oct 16, 2024

This is kind of a duplicate of #1396 ...

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

No branches or pull requests

3 participants