Re: fio offset with ba

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

 



Hi,

On 20 October 2017 at 20:08, Jeff Furlong <jeff.furlong@xxxxxxx> wrote:
>
> I don't quite follow the logic in the calculate offset function.  The offset parameter recently allows a percentage.  Suppose we set it to 50% and want to block align the IO's starting at 50% of device capacity, then block aligned to 8KB.
>
> # fio -version
> fio-3.1-60-g71aa
>
> # blockdev --getsize64 /dev/nvme1n1
> 3200631791616
>
> # fio --name=test_job --ioengine=libaio --direct=1 --rw=read --iodepth=1 --size=100% --bs=4k --filename=/dev/nvme1n1 --runtime=1s --offset=50% --log_offset=1 --write_iops_log=test_job --ba=8k
>
> # cat test_job_iops.1.log
> 0, 1, 0, 4096, 1600315895808
> 0, 1, 0, 4096, 1600315899904
> 0, 1, 0, 4096, 1600315904000
> 0, 1, 0, 4096, 1600315908096
>
> So we can see the device has 3200631791616 bytes, 50% of which is 1600315895808 bytes, which happens to be 4KB aligned, but not 8KB aligned.  Even though we set the --ba=8k parameter, the offset LBA as logged in the iops.1.log shows

Hmm I see the same problem with this job:
fio --name=test_job --ioengine=null --rw=read --iodepth=1
--size=3200631791616 --bs=4k --number_ios=1 --offset=50% --ba=8k
--debug=io

[...]
io       15013 fill_io_u: io_u 0x236ad80:
off=1600315895808/len=4096/ddir=0io       15013 /test_job.0.0io
15013

I think your guess about only impacting random I/O is probably right because
fio --name=test_job --randrepeat=0 --ioengine=null --rw=randread
--iodepth=1 --size=3200631791616 --bs=4k --number_ios=1 --offset=50%
--ba=8k --debug=io

picks offsets that are 8k aligned.

> 4KB alignment.  Does --ba work for all IO's or only random IO's?  If all, does get_start_offset() control the raw offset value?  I don't see why the min(ba, bs) is used in the calculation, but perhaps I am missing something.  Thanks.

Where is min(ba, bs) done - do you mean the bits around
https://github.com/axboe/fio/commit/89978a6b26f81bdbd63228e2e2a86f604ee46c56#diff-4abbf037246dd2e450dc3f6a2ac77180R845?
I agree you probably want to take the maximum of all the block
alignments but what if one of the smaller ones is not a multiple of
the largest one?

Would you like to propose a patch?

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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