Menu

O_DIRECT vs FS/device block size

Direct IO works faster if operations regions boundaries are aligned to image file's filesystem or shared device block size. In case of unaligned access each write operation needs to read data from blocks at unaligned begin and end of requested region, then merge it with data came in request and then write combined buffer to file/device. Read request is also not good - actually system reads more data from device than requested, and puts only part of it to requester's buffer that obviously is not very efficient. Today's ext* FS use commonly block size of 4KB, and same block size goes into favor of large HDD manufacturers. However currently AoE supports blindly 512 bytes block that makes it work slower or consume more resources of target hardware that it could when working in O_DIRECT.
Today I commited changes to AoEde to overcome this as possible: AoEde when possible recombines sequential read/write operations so final disk reads/writes will go by offsets/sizes aligned to block size.

Posted by Killer{R} 2014-06-22 Labels: block size 4k sector

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.