Documentation Examples for kb_base are incorrect.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have come across this issue with the description of how kb_base works.

In the documentation it says:
For quantities of data, an optional unit of ‘B’ may be included (e.g.,
‘kB’ is the same as ‘k’).
Whereas Ki and KiB are treated differently, which contradicts the documentation.

The description of the units has K,M,G,T,P and Ki,Mi,Gi,Ti,Pi whereas
the units that fio uses in __get_mult_bytes in parse.c:217 are
K,M,G,T,P (optional B) and KiB,MiB,GiB,TiB,PiB (mandatory B) and Ki
will be treated as K, Mi as M, etc. per this test file:

[job1]
bs=1M
[job2]
bs=1MB
[job3]
bs=1Mi
[job4]
bs=1MiB
returns:

job1: (g=0): rw=read, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T)
1024KiB-1024KiB, ioengine=posixaio, iodepth=1
job2: (g=0): rw=read, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T)
1024KiB-1024KiB, ioengine=posixaio, iodepth=1
job3: (g=0): rw=read, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T)
1024KiB-1024KiB, ioengine=posixaio, iodepth=1
job4: (g=0): rw=read, bs=(R) 977KiB-977KiB, (W) 977KiB-977KiB, (T)
977KiB-977KiB, ioengine=posixaio, iodepth=1

And with kb_base=1000:
job1: (g=0): rw=read, bs=(R) 1000kB-1000kB, (W) 1000kB-1000kB, (T)
1000kB-1000kB, ioengine=posixaio, iodepth=1
job2: (g=0): rw=read, bs=(R) 1000kB-1000kB, (W) 1000kB-1000kB, (T)
1000kB-1000kB, ioengine=posixaio, iodepth=1
job3: (g=0): rw=read, bs=(R) 1000kB-1000kB, (W) 1000kB-1000kB, (T)
1000kB-1000kB, ioengine=posixaio, iodepth=1
job4: (g=0): rw=read, bs=(R) 1049kB-1049kB, (W) 1049kB-1049kB, (T)
1049kB-1049kB, ioengine=posixaio, iodepth=1

Also the documentation examples are identical for both values with
some errors in raw numbers (TB):
Examples with kb_base=1000:
4 KiB: 4096, 4096b, 4096B, 4ki, 4kib, 4kiB, 4Ki, 4KiB
1 MiB: 1048576, 1mi, 1024ki
1 MB: 1000000, 1m, 1000k
1 TiB: 1099511627776, 1ti, 1024gi, 1048576mi
1 TB: 1000000000, 1t, 1000m, 1000000k

Examples with kb_base=1024 (default):
4 KiB: 4096, 4096b, 4096B, 4k, 4kb, 4kB, 4K, 4KB
1 MiB: 1048576, 1m, 1024k
1 MB: 1000000, 1mi, 1000ki
1 TiB: 1099511627776, 1t, 1024g, 1048576m
1 TB: 1000000000, 1ti, 1000mi, 1000000ki

Which should read (as it currently works in code):
Examples with kb_base=1000:
4 KiB: 4096, 4096b, 4096B, 4kib, 4kiB, 4KiB
1 MiB: 1048576, 1mib, 1024kib
1 MB: 1000000, 1m, 1000k, 1mi, 1mb, 1000ki
1 TiB: 1099511627776, 1tib, 1024gib, 1048576miB
1 TB: 1000000000000, 1t, 1000g, 1000000m

Examples with kb_base=1024 (default):
4 KiB: 4000, 4000b, 4000B
1 MiB: 1000000, 1000kib
1 MB: 1048576, 1mi, 1024ki, 1m
1 TiB: 1000000000000, 1000gib, 1000000mib
1 TB: 1099511627776, 1ti, 1048576Mi, 1024g

I can see the Ki vs KiB already has an issue here:
https://github.com/axboe/fio/issues/1618
With that fixed only the examples in the documentation would need to be updated.

-- 
Regards,

Sean





[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux