From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 27 20:57:10 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADD22A52; Fri, 27 Mar 2015 20:57:10 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC0F63F; Fri, 27 Mar 2015 20:57:10 +0000 (UTC) Received: by wiaa2 with SMTP id a2so46902954wia.0; Fri, 27 Mar 2015 13:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=iCyvXgsqub+pq79CCi4sabBy0JgyZ76LZkvRyrl1PX8=; b=O1HjpK3BnBmCDPDp+DdnklS7PTPu4aHaWOTFdXG3UVKgbayw3qkGuAqagW7LaO0eEi pMFmpWm1OWnmTJiXWRQ5xx8pdvxIBy/IImW2ShfU6W6Hw9yMKRnGdz6kFwVyD88BLzud 6UypCB259UztJk4LgSWEA2K49UkIavi57yzkHqlAA1HX/KQUIW/bsCL9csHRwyPFXV2v FwgZ6p1qrovq11EdP78QNS+iENpxSoBEqsVXTqKtQMfVo0nvPv3Ob/Bjgb/ITAuT4N6M NNPxcn0rzZR7mV3gLZBVGRvNm8sa7g+TaBcKZyb6bO9zARBkT4h5lugEJnXJnMKPY4if jGPQ== X-Received: by 10.180.89.163 with SMTP id bp3mr1141313wib.88.1427489828595; Fri, 27 Mar 2015 13:57:08 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id bd1sm5001614wib.13.2015.03.27.13.57.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 13:57:07 -0700 (PDT) Sender: Alexander Motin Message-ID: <5515C421.4040703@FreeBSD.org> Date: Fri, 27 Mar 2015 22:57:05 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: freebsd-fs@FreeBSD.org, "freebsd-hackers@freebsd.org" Subject: MAXBSIZE increase Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2015 20:57:10 -0000 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? -- Alexander Motin