From owner-freebsd-current@FreeBSD.ORG Thu May 14 15:29:47 2015 Return-Path: Delivered-To: freebsd-current@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 27C6929A for ; Thu, 14 May 2015 15:29:47 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id DE4FC1971 for ; Thu, 14 May 2015 15:29:46 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 68F023BB88; Thu, 14 May 2015 15:29:45 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id t4EFTiLn048539; Thu, 14 May 2015 15:29:44 GMT (envelope-from phk@phk.freebsd.dk) To: Alfred Perlstein cc: freebsd-current@freebsd.org Subject: Re: Increase BUFSIZ to 8192 In-reply-to: <5554B8D6.1010705@mu.org> From: "Poul-Henning Kamp" References: <14994.1431412293@critter.freebsd.dk> <20150513080342.GE37063@funkthat.com> <55530CC3.1090204@selasky.org> <1431528249.1221.15.camel@freebsd.org> <20150513181347.GM37063@funkthat.com> <1431542835.1221.30.camel@freebsd.org> <20150514072155.GT37063@funkthat.com> <62511.1431589335@critter.freebsd.dk> <20150514075316.GY37063@funkthat.com> <77887.1431590789@critter.freebsd.dk> <6AE8973B-3C03-497F-85A9-96C4D464B4BD@gmail.com> <5554B8D6.1010705@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <48537.1431617383.1@critter.freebsd.dk> Date: Thu, 14 May 2015 15:29:44 +0000 Message-ID: <48538.1431617384@critter.freebsd.dk> X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2015 15:29:47 -0000 -------- In message <5554B8D6.1010705@mu.org>, Alfred Perlstein writes: >Shouldn't most of these be using st.st_blksize ? We had a long discussion about that back when GEOM was young and the conclusionis that st_blksize doesn't tell you anything useful and generally does the wrong thing, in particular on non-native filesystems like msdosfs and cd9660. But the world is more complex than even that. For instance on a RAID-5 volume, you want to write stripe-width chunks, properly aligned, no matter what the st_blksize might be in your filesystem. Unless your filesystem is guaranteed to lay out sequentially, you would have to ask before each write. Other filesystems may have opinions about read-sizes (ie: NFS). The only sane way to do this properly would be to ask each individual file with fcntl(2) for preferred read or write sizes. You could then have embedded system mount filesystems with -o iosize=min and servers instead use -o iosize=fastest But for most practical purposes, having a sane constant BUFSIZ is just fine. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.