ZFS vs UFS2 overhead and may be a bug?

Bruce Evans bde at zeta.org.au
Fri May 4 05:45:30 UTC 2007


On Thu, 3 May 2007, Bakul Shah wrote:

>> Interesting. There are two problems. First is that cat(1) uses
>> st_blksize to find out best size of I/O request and we force it to
>> PAGE_SIZE, which is very, very wrong for ZFS - it should be equal to
>> recordsize. I need to find discussion about this:

>> ...
>> 	sb->st_blksize = PAGE_SIZE;
>
> This does seem suboptimal.  Almost always one reads an entire

It's just broken.

> file and the overhead of going to the disk is high enough
> that one may as well read small files in one syscall.  Apps
> that want to keep lots and lots of files open can always
> adjust the buffer size.
>
> Since disk seek access time is the largest cost component,
> ideally contiguously allocated data should be read in one
> access in order to avoid any extra seeks.  At the very least

Buffering makes the userland i/o size have almost no effect on
physical disk accesses.  Perhaps even for zfs, since IIRC your
benchmark showed anamolies for the case of sparse files where
no disk accesses are involved.

> st_blksize should be as large as the minimum unit of
> contiguous allocation (== filesystem block size).  Even V7
> unix had this!

FreeBSD-1.1-FreeBSD-5 also have this (== filesystem block size >
filesystem frag size for ffs).

Bruce


More information about the freebsd-fs mailing list