MAXBSIZE increase

Alexander Motin mav at FreeBSD.org
Sat Mar 28 17:21:02 UTC 2015


On 28.03.2015 19:13, Konstantin Belousov wrote:
> On Fri, Mar 27, 2015 at 10:57:05PM +0200, Alexander Motin wrote:
>> Experimenting with NFS and ZFS I found an inter-operation issue: ZFS by
>> default uses block of 128KB, while FreeBSD NFS (both client and server)
>> is limited to 64KB requests by the value of MAXBSIZE. On file rewrite
>> that limitation makes ZFS to do slow read-modify-write cycles for every
>> write operation, instead of just writing the new data.  Trivial iozone
>> test show major difference between initial write and rewrite speeds
>> because of this issue.
>>
>> Looking through the sources I've found and in r280347 fixed number of
>> improper MAXBSIZE use cases in device drivers. After that I see no any
>> reason why MAXBSIZE can not be increased to at least 128KB to match ZFS
>> default (ZFS now supports block up to 1MB, but that is not default and
>> so far rare). I've made a test build and also successfully created UFS
>> file system with 128KB block -- not sure it is needed, but seems it
>> survives this change well too.
>>
>> Is there anything I am missing, or it is safe to rise this limit now?
> 
> This post is useless after the Bruce explanation, but I still want to 
> highlidht the most important point from that long story:
> 
> increasing MAXBSIZE without tuning other buffer cache parameters
> would dis-balance the buffer cache.  Allowing bigger buffers increases
> fragmentation, while limiting the total number of buffers.  Also, it
> changes the tuning for runtime limits for amount of io in flight, see
> hi/lo runningspace initialization.

I would be happy if somebody with more skills in buffer cache brought
some order into that area, hopefully once and forever.

-- 
Alexander Motin


More information about the freebsd-fs mailing list