From owner-freebsd-fs@FreeBSD.ORG Sat Mar 28 17:13:21 2015 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCF82247; Sat, 28 Mar 2015 17:13:21 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DF39C43; Sat, 28 Mar 2015 17:13:21 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2SHDFZ8056343 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 Mar 2015 19:13:15 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2SHDFZ8056343 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2SHDFlN056342; Sat, 28 Mar 2015 19:13:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Mar 2015 19:13:15 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: MAXBSIZE increase Message-ID: <20150328171315.GU2379@kib.kiev.ua> References: <5515C421.4040703@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5515C421.4040703@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-fs@FreeBSD.org, "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2015 17:13:21 -0000 On Fri, Mar 27, 2015 at 10:57:05PM +0200, Alexander Motin wrote: > Hi. > > 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.